// Alýþveriþ arama 1
function Search(myfield,e,flag)
{
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	if (keycode == 13 || flag == 1)
	{
		var turkceler="ý,Ý,þ,Þ,ö,Ö,ç,Ç,ü,Ü,ð,Ð,";
		var encoded="Ä±,Ä°,ÅŸ,Åž,Ã¶,Ã–,Ã§,Ã‡,Ã¼,Ãœ,ÄŸ,Äž,";
	
		var yert=0;
		var yere=0;
		var enc="";
		str = Trim(document.frmSrc.q.value);
		while(turkceler.length!=0)
		{
			yert=turkceler.indexOf(",");
			yere=encoded.indexOf(",");
			while(str.indexOf(turkceler.substring(0,yert))!=-1)
			{
				str = str.replace(turkceler.substring(0,yert),encoded.substring(0,yere));
			}
			turkceler=turkceler.substring(yert+1,turkceler.length);
			encoded=encoded.substring(yere+1,encoded.length);
		}
		document.frmSrc.query.value=str;
		
		if (str.length < 2)
		{
			alert("En az iki harf içeren bir kelime giriniz");
		}
		else
		{
			document.frmSrc.submit();
		}
	}
}

function LTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {

      var i = s.length - 1;       // Get length of string
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;

      s = s.substring(0, i+1);
   }
   return s;
}

function Trim(str)
{
   return RTrim(LTrim(str));
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.0001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + num );
}
// Alýþveriþ arama 0

function done(){
	SetDeptID('2');
	return isDomainNameValid(document.step1.elements['SRS_DOMAIN_LIST']);	
}
function popup(url,windowWidth,windowHeight,windowTitle){
if (windowWidth == null) { windowWidth = 550 }
if (windowHeight == null) { windowHeight = 500 }

var newWindow = null;
newWindow=window.open('','newWindow','width=' + windowWidth + ',height=' + windowHeight + ',status=no,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizable=yes,alwaysRaised=yes,screenX=20,screenY=5,titlebar=yes,z-lock=yes,left=' + (screen.width - windowWidth) / 2 + ',top=' + (screen.height - windowHeight) / 2);
if (newWindow != null) {
if (newWindow.opener == null){ newWindow.opener = self; } 
if (windowTitle != "") { newWindow.document.title=windowTitle; }
newWindow.location.href=url;
newWindow.focus();
}
}
function submitavs(myfield,e,flag){
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13){avsGo(flag); return false;}
else return true;
}

function avsGo(inQuery){ 
	var f = document.avsform;
	var found = false;
	for (var k = 0;k<f.q.value.length;k++){
		if (f.q.value.charAt(k) == "") found = true;
	}
	var str = "'é<!>£^#$%½&{[]=}?\*\\€|@#;¨~´`,;";
	for (var i = 0;i<f.q.value.length;i++){
		for (var j = 0;j<str.length;j++){
			if (f.q.value.charAt(i) == str.charAt(j)) found = true;
		}
	}
	if (found){
		alert("Lütfen arama yapabilmek için geçerli karakter giriniz.");
	}else{
		document.avsform.submit(); 
	}
}
function popupsoz(url){
	var yenipencere = null;
	yenipencere=window.open('','yenipencere','width=328,height=208,status=no,toolbar=no,menubar=no,directories=no,location=no,scrollbars=no,resizable=no,alwaysRaised=no,screenX=20,screenY=5,titlebar=yes,z-lock=yes,left=' + (screen.width - 328) / 2 + ',top=' + (screen.height - 286) / 2);
	if(yenipencere != null){
		if(yenipencere.opener == null){
			yenipencere.opener = self;
		}
		yenipencere.location.href=url;
		yenipencere.focus();
	}
} 
function popup(url,windowWidth,windowHeight,windowTitle){
	if (windowWidth == null) { windowWidth = 550 }
	if (windowHeight == null) { windowHeight = 500 }
	
	var newWindow = null;
	newWindow=window.open('','newWindow','width=' + windowWidth + ',height=' + windowHeight + ',status=no,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizable=no,alwaysRaised=no,screenX=20,screenY=5,titlebar=yes,z-lock=yes,left=20,top=130');
	if (newWindow != null) {
		if (newWindow.opener == null){ newWindow.opener = self; } 
		if (windowTitle != "") { newWindow.document.title=windowTitle; }
		newWindow.location.href=url;
		newWindow.focus();
	}
}


// Newscorner 1
function dC(c,cc)
{
	var bgcolor = '#F3F3F3';
	var colspan = '';
	if (cc) { var colspan = 'colspan='+cc; }
	if (c == 0) { return '<td '+colspan+' style="width:1px;height:1px;"></td>'; }
	else if (c == 100) { return '<td '+colspan+' style="background-color:'+bgcolor+';width:1px;height:1px;"></td>'; }
	else { return '<td '+colspan+' style="background-color:'+bgcolor+';width:1px;height:1px;filter:alpha(opacity='+c+');"></td>'; }
}
function dL(l)
{
	return '<tr>\n'+l+'\n</tr>\n';
}
function drawCorner ()
{
	var drawHTML = '';
	drawHTML += dL(dC(0)+dC(18)+dC(38)+dC(61)+dC(85)+dC(100,5));
	drawHTML += dL(dC(0,4)+dC(18)+dC(61)+dC(100,4));
	drawHTML += dL(dC(0,6)+dC(38)+dC(93)+dC(100,2));
	drawHTML += dL(dC(0,7)+dC(38)+dC(100)+dC(100));
	drawHTML += dL(dC(0,8)+dC(61)+dC(100));
	drawHTML += dL(dC(0,8)+dC(18)+dC(93));
	drawHTML += dL(dC(0,9)+dC(61));
	drawHTML += dL(dC(0,9)+dC(38));
	drawHTML += dL(dC(0,9)+dC(18));
	drawHTML += dL(dC(0)+dC(0)+dC(0)+dC(0)+dC(0)+dC(0)+dC(0)+dC(0)+dC(0)+dC(0));
	document.write('<table width="10" height="10" border="0" cellspacing="0" cellpadding="0">\n'+drawHTML+'</table>\n');
}
// Newscorner 0


// Newsticker 1
var newslist=new Array();
var newslistIdx = 0;
var cnt=0;
var curr = "";
var i=-1;
function newsticker()
{
  if (i < newslist[cnt][0].length - 1)
  {
    i++;
    temp1 = newslist[cnt][0];
    temp1 = temp1.split('');
    curr = curr+temp1[i];
    temp2 = newslist[cnt][1];
	newsData = "<a href='"+temp2+"' class='nwslnk1' style='color:#333399;font-weight:bold;'>"+curr+"</a>";
	if(document.getElementById) document.getElementById("mtxt").innerHTML = newsData;
	else if(document.all) document.all.mtxt.innerHTML = newsData;
    setTimeout('newsticker()',10)
    return;
  }
  i = -1; curr = "";
  if (cnt<newslist.length-1)
    cnt++;
  else
    cnt=0;
  setTimeout('newsticker()',5000)
}

function getTop(name)
{
	if(document.getElementById) return document.getElementById(name).offsetTop;
	else if(document.all) return document.all.name.offsetTop;
}
function setTop(name,top)
{
	if(document.getElementById) document.getElementById(name).style.top = top;
	else if(document.all) document.all.name.style.top = top;
}

function syncTop()
{
	setTop('mtxt',getTop('mtxtPos'));
}


// Newsticker 0

