﻿function TextBoxOver(textbox) 
{
tb=document.getElementById(textbox);
tb.className='TextBoxOver';
}

function TextBoxOut(textbox) 
{
tb=document.getElementById(textbox);
tb.className='TextBox';
}

function LoginOver(btn) 
{
bt=document.getElementById(btn);
bt.src='/Images/AdminImages/GirisOver.jpg';
}

function LoginOut(btn) 
{
bt=document.getElementById(btn);
bt.src='/Images/AdminImages/Giris.jpg';
}


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 ExpandDiv(divid,imgid,expandimg,collsimg)
{
    div=document.getElementById(divid)
    img=document.getElementById(imgid)
    if (div)
    {
        if (div.getAttribute ('state')=='closed')
        {       
           div.setAttribute ('state','opened');
           div.style.display = 'block';
           img.src=collsimg;
        }
        else
        {
          div.setAttribute ('state','closed');
          div.style.display = 'none';
          img.src= expandimg;
        }
    }
    
}

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('/NDC/Admin/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 TextCounter(gtext,gdiv,maxchar) 
{
text=document.getElementById(gtext);
div=document.getElementById(gdiv);
    if (text.value.length > maxchar)
    {
        text.value = text.value.substring(0, maxchar);
        div.className='hata';
        div.innerHTML = 'Bu Alana En Fazla ' + maxchar +' Karakter Girebilirsiniz.';      
        div.style.display = 'block';
    }
    else
    {
        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 getSwf(movieLink,genislik,yukseklik)
{

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" /><param name="bgcolor" value="#ffffff" /><embed wmode="window"  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 openSwf(link)
{
window.open('/NDC/Admin/Content/Ayarlar/Flash/FlashGoster.aspx?Link='+link ,'opengame','resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=550,height=330');
}

 function ViewFile(file)
 {
 file1=document.getElementById(file);
 //img1=document.getElementById(img);
 //img1.src='file:///'+ file1.value.replace('\\','/');
 window.open('file:///C:/Documents%20and%20Settings/aytek/Desktop/article_CursorSQLServer.html');
 
 }

 function goster(imagepath,ix,iy)
{
  window.open('/NDC/Admin/Content/Ayarlar/SwfResim/resimGoster.aspx?img=' +imagepath ,'','width='+ix+',height='+iy+',resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no');
}

