﻿function gotoQuestion(id)
{
window.open("default.aspx?page=questions&status=view&co="+id,"","_seft","");
}
function gotoURL(page,type,child) {
    if (page == "img") {
        window.location.href = "default.aspx?page=imgtl&child="+child+"&stype=" + type + "";
    }
    else{
    window.open("default.aspx?page="+page+"&status=view&co=" + id, "", "", "");
    }
}
function hideHelpSearch(div,textid,labelS)
{
if(document.getElementById(textid).value=="")
{
document.getElementById(textid).value="Nhập từ khóa";
document.getElementById(textid).style.border="solid 1px #d8d8d8";
}
var divs=window.document.all[div];
var divls=window.document.all[labelS];
if(divs!=null)
{
divls.style.display="none";
divs.style.height="";
divs.className="";
document.getElementById(textid).style.border="solid 1px #d8d8d8";
}
}
function showHelpSearch(div,textid,labelS)
{
if(document.getElementById(textid).value=="Nhập từ khóa")
{
document.getElementById(textid).value="";
document.getElementById(textid).style.border="solid 1px #ffe2a4";
}
var divs=window.document.all[div];
var divls=window.document.all[labelS];
if(divs!=null)
{
divls.style.display="block";
divs.style.height="50px";
divs.style.width="140px";
divs.className="backSearch";
}
}


function CheckExtend(filename)
{
if(filename!="")
{
var control=document.getElementById(filename);
//var ext=control.value.toString().split('.');
if (control != null) {
    if (control.value.toString().toLowerCase().lastIndexOf(".jpg") == -1 && control.value.toString().toLowerCase().lastIndexOf(".png") == -1 && control.value.toString().toLowerCase().lastIndexOf(".gif") == -1 && control.value.toString().toLowerCase().lastIndexOf(".bmp") == -1) {
        alert("File upload không đúng định dạng, Vui lòng chọn file có phần mở rộng .jpg|.png|.gif|.bmp");
        return false;
    }
    else return true;
}
else
    return true;
}
else
return false;
}
// message thong bao xoa item

function checkDelete(id,message)
{
var item=document.getElementsByName(id);
var ok=false;
for(i=0;i<item.length;i++)
{
if(item[i].checked==true)
{
ok= confirm("Bạn có chắc muốn xóa không ?");
return ok;
}
}
alert(message);
return false;
}
function chatList(nick)
{
var ss=document.getElementById(nick);
var s=document.createElement("<img>");
s.setAttribute("src","http://opi.yahoo.com/online?u=aaaa;m=g&amp;t=3&amp;l=us");
var arrNick=nick.split(":");
for(i=0;i<arrNick.length;i++)
{

}
}

function onchangeLink(page) {
    var lienket = document.getElementById(page);
    window.open(lienket.value, "", "menubar=1,resizable=1,toolbar=1,location=1,scrollbars=1,width=550,height=450");
}
function OpenPage(page) {
    window.open(page, "", "menubar=0,resizable=0,toolbar=1,location=1,scrollbars=0,width=650,height=350");
}
