﻿// JScript File

function SendAvatar(targetid,targetvalue,picture)
{
    window.opener.document.getElementById(targetid).value=targetvalue;
    window.opener.document.getElementById(picture).src=targetvalue;
    window.close();
    window.opener.focus();
}
 
 function Display(textbox,value)
{
    txt=document.getElementById(textbox) 
    if (value == -1 )
    {
        txt.style.display = 'block';
    }
    else
    {    
        txt.style.display = 'none';
    }
    
}
 function DisableControl(cntr,value)
{
    control=document.getElementById(cntr) 
    if (value == -1 )
    {
        control.style.width='0px'; 
        control.style.height='0px';
    }
    
}
function Overflow(div)
{
document.getElementById(div).style.overflow="auto";
}

 
function approveMessage(message){
	if(confirm(message)) return true;
	return false;	
}

function alertMessage(message){
    alert(message);
}

function takvim (btn,txt,saat){
if (saat== true)
{
Zapatec.Calendar.setup({
						firstDay          : 1,
					weekNumbers       : true,
					showOthers        : true,
					showsTime         : true,
					timeFormat        : "24",
					ampm			  : false,
					   step              : 2,
					    range             : [1900.01, 2999.12],
					    electric          : false,
					    singleClick       : false,
					    inputField        : txt,
					    button            : btn,
						ifFormat		  : "%d.%m.%Y  %H:%M",
					    daFormat          : "%d.%m.%Y  %H:%M",
					    align             : "Br"
					  });
					  }
					  
else{
Zapatec.Calendar.setup({
						firstDay          : 1,
					weekNumbers       : true,
					showOthers        : true,
					showsTime         : false,
					timeFormat        : "24",
					ampm			  : false,
					   step              : 2,
					    range             : [1900.01, 2999.12],
					    electric          : false,
					    singleClick       : false,
					    inputField        : txt,
					    button            : btn,
						ifFormat		  : "%d.%m.%Y",
					    daFormat          : "%d.%m.%Y",
					    align             : "Br"
					  });
}

}		


function viewImage(imagepath)
{
    window.open('/Popup/viewImage.aspx?img=' +imagepath ,'viewimage','resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=10,height=10');
}

function autoSize() {
IE5=NN4=NN6=false;
if(document.all)IE5=true;
else if(document.layers)NN4=true;
else if(document.getElementById)NN6=true;
if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31+20);
else if(NN6) self.sizeToContent();
else top.window.resizeTo(document.images[0].width,document.images[0].height+20);
self.focus();
}
function OpenSearchTab(ActiveTab,ActivePanel,InactivePanel)
{ 
 
_UserTab=document.getElementById('UserTab');
_GroupTab=document.getElementById('GroupTab');

 Apanel=document.getElementById(ActivePanel);
 IAPanel=document.getElementById(InactivePanel);

 Apanel.style.display = 'block';
 IAPanel.style.display = 'none';
    
    if (ActiveTab=='UserTab'){
        _UserTab.className='ActiveUserSearchTab';
        _GroupTab.className='InActiveGroupSearchTab';
    }
    else
    {
        _UserTab.className='InActiveUserSearchTab';
        _GroupTab.className='ActiveGroupSearchTab';
    }
}

function TextBoxOver(textbox) 
{
    tb=document.getElementById(textbox);
    tb.className='LoginTxtOver';
}
function Chech_checkbox(chk)
{
  box=document.getElementById(chk);
    box.checked='checked';
    }
function TextBoxOut(textbox) 
{
    tb=document.getElementById(textbox);
    tb.className='LoginTxt';
}

function KutuOver(img) 
{
    image=document.getElementById(img);
    image.src='/Images/kutuOverMouse.jpg'
}

function KutuOut(img) 
{
    image=document.getElementById(img);
    image.src='/Images/kutuOutMouse.jpg'
}




function TextCounter(gtext,gdiv,maxchar) 
{
if (maxchar==0) {maxchar=100;}
text=document.getElementById(gtext);
div=document.getElementById(gdiv);
    if (text.value.length > maxchar)
    {
        text.value = text.value.substring(0, maxchar);
        if (div!=null){
        div.className='hata';
        div.innerHTML = 'Bu Alana En Fazla ' + maxchar +' Karakter Girebilirsiniz.';      
        div.style.display = 'block';}
        else{alert('Bu Alana En Fazla ' + maxchar +' Karakter Girebilirsiniz.');}
    }
    else
    {
    if (div!=null){
        div.style.display = 'none';
        div.InnerHtml = '';}
    }
}


function showPicture( imgName, imgCaption, imgWidth, imgHeight, textColor, bgColor ) {
	if (imgWidth<=100) {
		imgWidth=100;
		}
	if (imgHeight<=100) {
		imgHeight=100;
		}
	winHeight=imgHeight+30;
	w = window.open('','Demo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width='+imgWidth+',height='+winHeight);
	w.document.write("<html><head><title>"+imgCaption+"</title>" );
	w.document.write("<STYLE TYPE='text/css'>" );
	w.document.write("A {font-family: verdana; font-size: 10px; color: "+textColor+"; text-decoration : none;}" );
	w.document.write("A:Visited {font-family: verdana;font-size: 10px; color: "+textColor+"; }" );
	w.document.write("A:Active { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
	w.document.write("A:Hover { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
	w.document.write("IMG {border-color : "+textColor+";}" );
	w.document.write("BODY { font-family: verdana; font-size : 10px; font-weight: normal; color : "+textColor+"; background-color : "+bgColor+"; }" );
	w.document.write("</STYLE>");
	w.document.write(String.fromCharCode(60)+"script language='JavaScript'"+String.fromCharCode(62));
	w.document.write("IE5=NN4=NN6=false\n");
	w.document.write("if(document.all)IE5=true;\n");
	w.document.write("else if(document.getElementById)NN6=true\n");
	w.document.write("else if(document.layers)NN4=true\n");
	w.document.write("function autoSize() {\n");
	w.document.write("if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31+20)\n");
	w.document.write("else if(NN6) self.sizeToContent()\n");
	w.document.write("else top.window.resizeTo(document.images[0].width,document.images[0].height+20)\n");
	w.document.write("self.focus()\n");
	w.document.write("}\n</scr");
	w.document.write("ipt>\n");
	w.document.write("</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=" );
	w.document.write("'javascript:autoSize();'>" );
	w.document.write("<table cellpadding=0 cellspacing=0 border=0><tr><td colspan=3><img src='"+imgName+"' border=0 alt='"+imgCaption+"'></td></tr>" );
	w.document.write("<tr><td align='left'><a>&nbsp;© Kidynet</a></td>" );
	w.document.write("<td align='center'></td>" );
	w.document.write("<td align='right' ><a href='javascript:top.window.close();'>KAPAT</a>&nbsp;</td></tr>" );
	w.document.write("</table></body></html>" );
	w.document.close();
}

function addFavourits(baslik,url) {
 if (window.sidebar)
 {
    window.sidebar.addPanel(baslik, url,"");
  }
  else if( document.all )
  {
    window.external.AddFavorite( url, baslik);
  }
  else
  {
    return true;
    }
}

function HomePage(obj,url)
{
obj.style.behavior='url(#default#homepage)';
obj.setHomePage(url); 
}
 
 
 function GetGame(id,gamepath)
 {
 window.open(gamepath ,'','resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=800,height=600');
 //iframe için
//  iframe=document.getElementById(id);
// iframe.src=gamepath;
 }
 
 function Changeavatar(img,file)
 {
 file1=document.getElementById(file);
 img1=document.getElementById(img);
 img1.src='file:///'+ file1.value.replace('\\','/');
 //alert (img1.src);
 
 }
 
 
 
 
 
  function hideScrollBars(doc)
{
   doc1=document.getElementById(doc);
   doc1.style.overflow='hidden';
    
}

  function showScrollBars(doc)
{
   doc1=document.getElementById(doc);
   doc1.style.overflow='auto';
    
}

function focusPassword(e, passwordText){ 

      var bt = document.getElementById(passwordText);

      if (bt){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.focus();
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.focus();
                        return false; 
                  } 
            } 
      } 
 
} 

function clickLogin(e, loginButton){ 

      var bt = document.getElementById(loginButton);

      if (bt){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click();
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click();
                        return false; 
                  } 
            } 
      } 

}

  function FullHeight(obj1,obj2,var1,var2)
{
var pageHeight;

if( window.innerHeight && window.scrollMaxY ) // FF 
{ 
pageHeight = window.innerHeight + window.scrollMaxY+var1-var2;
}
else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
{ 
pageHeight = document.body.scrollHeight+var1-var2;
}
else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
{  
pageHeight = document.body.offsetHeight + document.body.offsetTop+var1-var2; 
} 
if (pageHeight>1700) return false;
 document.getElementById(obj1).style.height=(pageHeight)-24+'px' ;
 document.getElementById(obj2).style.height=(pageHeight)+'px'; 
}

function GetSwf(genislik,yukseklik,movieLink,div)
{
scrpt='';
scrpt += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + genislik + '" height="' + yukseklik + '" id="kidy" align="middle">';
scrpt += '<param name="scale" value="exactfit" />';
scrpt += '<param name="allowScriptAccess" value="sameDomain" />';
scrpt += '<param name="movie" value="' + movieLink + '" /><param name="quality" value="high" /><param name="wmode"   value="transparent" /><param name="bgcolor" value="#ffffff" /><embed wmode="transparent"  scale="exactfit"  src="' + movieLink + '" quality="high" bgcolor="#ffffff" width="' + genislik + '" height="' + yukseklik + '" name="kidy" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
scrpt += "</object>";
document.write (scrpt);
}
function GetGameSwf(genislik,yukseklik,movieLink,div)
{
scrpt='';
scrpt += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + genislik + '" height="' + yukseklik + '" id="kidy" align="middle">';
scrpt += '<param name="scale" value="exactfit" />';
scrpt += '<param name="allowScriptAccess" value="sameDomain" />';
scrpt += '<param name="movie" value="' + movieLink + '" /><param name="quality" value="high" /><param name="wmode"   value="window" /><embed wmode="window"  scale="exactfit"  src="' + movieLink + '" quality="high"    width="' + genislik + '" height="' + yukseklik + '" name="kidy" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
scrpt += "</object>";
document.write (scrpt);
}

function GetMenu(genislik,yukseklik,flashbtn,btn)
{
divgenislik=genislik+2
scrpt='';
scrpt='<div style="display:table; display:block;width:'+ divgenislik  +'px;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
scrpt+='width="'+ genislik +'"  height="'+ yukseklik  +'" id="spor" align="middle">';
scrpt+='<param name="allowScriptAccess" value="sameDomain" />';
scrpt+='<param name="movie" value="/swf/'+ flashbtn +'" />';
scrpt+='<param name="quality" value="high" />';
scrpt+='<param name="bgcolor" value="#ffffff" />';
scrpt+='<param name="FlashVars" value="btn='+btn+'&fnc=clickTab">';
scrpt+='<embed src="/swf/' + flashbtn +'" FlashVars="btn='+btn+'&fnc=clickTab" quality="high" bgcolor="#ffffff" width="'+genislik+'" height="'+  yukseklik +'" name="spor"';
scrpt+='align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash"';
scrpt+='pluginspage="http://www.macromedia.com/go/getflashplayer" />';
scrpt+='</object></div>';
document.write (scrpt);
}

function GetKidyZoneGameSwf(genislik,yukseklik,movieLink,div,Game,code)
{
scrpt='';
scrpt += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + genislik + '" height="' + yukseklik + '" id="kidy" align="middle">';
scrpt += '<param name="scale" value="exactfit" />';
scrpt+='<param name="FlashVars" value="Game='+Game+'&code='+ code +'">';
scrpt += '<param name="allowScriptAccess" value="sameDomain" />';
scrpt += '<param name="movie" value="' + movieLink + '" /><param name="quality" value="high" /><param name="wmode"   value="window" /><param name="bgcolor" value="#ffffff" /><embed wmode="window"  scale="exactfit"  src="' + movieLink + '" FlashVars="Game='+Game+'&code='+ code +'"  quality="high" width="' + genislik + '" height="' + yukseklik + '" name="kidy" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
scrpt += "</object>";
document.write (scrpt);
}
