// JavaScript Document

function NewWindow(mypage,myname,w,h,scroll,pos)
{
var win=null;
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
}


// CSS ROLLOVER FONKSİYONLARI
function Addlink(formname,textname)
{
	var Range = document.selection.createRange();
	var tArea = document.getElementById(textname);
	var tText = tArea.value;
	var sText = Range.htmlText;
	if(sText!='')
	{
		var dText ='[A]'+sText+'[/A]';
		rText=tText.replace(sText,dText);
		tArea.value = rText;
	}
	else
	{
		alert('Lütfen önce yazmis oldugunuz url\'yi seçiniz');
	};
};

function pencereGenisliginiOku() {if (document.all) {return document.body.offsetWidth;} else {return window.innerWidth}};

function maxPencere() {var versiyon=parseInt(navigator.appVersion);var tarayici=navigator.appName;if (versiyon>3) {	if (tarayici=="Netscape") {if (top.screenX>0 || top.screenY>0) top.moveTo(0,0);if (top.outerWidth < screen.width)top.outerWidth=screen.width;if (top.outerHeight < screen.height) top.outerHeight = screen.height;}	else {top.moveTo(-4,-4);top.resizeTo(screen.width+8,screen.height+8);}}}

function getObj(name){if (document.getElementById)  {this.obj = document.getElementById(name);this.style = document.getElementById(name).style;}else if (document.all){this.obj = document.all[name];this.style = document.all[name].style;}else if (document.layers){this.obj = document.layers[name];this.style = document.layers[name];}}

function hideitem(katman) {if (document.all) {document.all[katman].style.visibility="hidden";	}else if (document.layers) {		document.layers[katman].visibility="hide";		}		else {			document.getElementById(katman).style.visibility="hidden";		}		}
function showitem(katman) {if (document.all) {	document.all[katman].style.visibility="visible";}else if (document.layers) {	document.layers[katman].visibility="show";	}	else {			document.getElementById(katman).style.visibility="visible";		}		}	

function ShowInfo(Name)
{
	if(document.getElementById)
	{
	var ar = document.getElementById(Name)
	ar.style.display='block';
	}
}
function HideInfo(Name)
{
	if(document.getElementById)
	{
	var ar = document.getElementById(Name)
	ar.style.display='none';
	}
}
function ShowIdentty(Name,Master)
{
	if(document.getElementById){
	var ar = document.getElementById(Name)
	ar.style.display='block';
	var er = document.getElementById(Master)
	er.style.border='1px solid';
	er.style.borderColor='#C9C9C9';
	}
}
function HideIdentty(Name,Master)
{
	if(document.getElementById){
	var ar = document.getElementById(Name)
	ar.style.display='none';
	var er = document.getElementById(Master)
	er.style.border='1px solid';
	er.style.borderColor='white';
	}
}
function SwitchTabMenu(master,SItem,Count,e)
{
	if(document.getElementById){
	var ar = document.getElementById(master).getElementsByTagName(e);
		for (i=0;i<ar.length;i++)
		{
			for (j=1;j<Count+1;j++)
			{
				

					if(ar[i].id=='Item'+j)ar[i].style.display='none';
			};
					if(ar[i].id=='Item'+SItem) 
					{
						if (ar[i].style.display=='block')
						{
							ar[i].style.display='none';
						}
						else
						{
							ar[i].style.display='block';
						};
					};
		};
	}
};

function HideTabMenuItems(master,Count,e)
{
if(document.getElementById){
	var ar = document.getElementById(master).getElementsByTagName(e);
		for (i=0;i<ar.length;i++)
		{
			for (j=1;j<Count+1;j++)
			{
				

					if(ar[i].id=='Item'+j)ar[i].style.display='none';
			};
		};
	}
};

function DW(Par1,Par2,Par3,Par4)
{
	if (Par1 == 'TCB')
	{
		document.write(TreeItemWithContentBegin(Par2,Par3,Par4));
	}
	if (Par1 == 'TCE')
	{
		document.write(TreeItemWithContentEnd());
	}
	if (Par1 == 'TNC')
	{
		document.write(TreeItemWithoutContent(Par2,Par3,Par4));
	}
	if (Par1 == 'TNCH')
	{
		document.write('<hr noshade class="bodyshown" width="200">');
	}
	if (Par1 == 'TB')
	{
		document.write(TableBegin());
	}
	if (Par1 == 'TE') 
	{
		document.write(TableEnd());
	}
	if (Par1 == 'SearchForm')
	{
		document.write(SearchForm());
	}
}
function SearchForm()
{
		txt = '<form name="SearchForm" method="post" action="Search.Asp" target="mainFrame">';
		txt=txt+'<table id="SearchFormtable" width="100%"><tr><td>';
		txt=txt+'<input name="SearchWord" type="text" class="formElement">';
		txt=txt+'<input name="Ara" type="submit" id="Ara" value="Ara" class="formElement">';
		txt=txt+'</td></tr></table>';
		txt=txt+'</form>';
		return txt;

};
function ColorTable(Part2) 
{
  
};
function TableBegin(Part2,Part3,Part4) {txt ='<table class="Tabpanelshow" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>';return txt;};
function TableEnd() { txt='</td></tr></table>';return txt;};

function TreeItemWithContentBegin(Num,pic,Text)
{
    var txt;
	txt='<table border="0" cellspacing="0" cellpadding="0" id="Treeitem'+Num+'">';
    txt=txt+'<tr id="Treeitem'+Num+'collapse" style="display:block">';
      txt=txt+'<td width="10"><img onclick="SwitchTreeItem(\'Treeitem'+Num+'\')" src="images/collapse.gif" width="16" height="16"></td>';
       txt=txt+'<td width="25"><img src="images/'+pic+'.gif" width="25" height="23"></td>';
  txt=txt+'<td>&nbsp;<a href="#" onclick="SwitchTreeItem(\'Treeitem'+Num+'\')">'+Text+'</a></td>';
   txt=txt+'</tr>';
    txt=txt+'<tr id="Treeitem'+Num+'expand" style="display:none"> ';
     txt=txt+'<td width="10"><img onclick="SwitchTreeItem(\'Treeitem'+Num+'\')" src="images/expand.gif" width="16" height="16"></td>';
 	txt=txt+'<td width="25"><img src="images/'+pic+'.gif" width="25" height="23"></td>';
 txt=txt+'<td>&nbsp;<a href="#" onclick="SwitchTreeItem(\'Treeitem'+Num+'\')">'+Text+'</a></td>';
    txt=txt+'</tr>';
    txt=txt+'<tr id="Treeitem'+Num+'content" style="display:none"> ';
      txt=txt+'<td width="10">&nbsp;</td>';
	  txt=txt+'<td width="25">&nbsp;</td>';
      txt=txt+'<td>';
  return txt;
}
function TreeItemWithContentEnd()
{
		var txt;
		txt = '</td></tr></table>';
		return txt;
}
function TreeItemWithoutContent(Num,Text,Link)
{
    var txt;
	txt='<table border="0" cellspacing="0" cellpadding="0" id="Treeitem'+Num+'">';
    txt=txt+'<tr id="Treeitem'+Num+'Link" style="display:block">';
      txt=txt+'<td width="10"><img src="images/sub.gif" width="16" height="16"></td>';
     txt=txt+'<td>&nbsp;<a href="'+ Link +'" target="mainFrame">'+Text+'</a></td>';
   txt=txt+'</tr>';
  txt=txt+'</table>';
  return txt;
}

function SwitchTreeItem(master){
if(document.getElementById)
{
	var ar = document.getElementById(master).getElementsByTagName("tr");
	
	for (i=0;i<ar.length;i++)
		{
			var collapse = master+'collapse';
			var expand = master+'expand';
			var content = master+'content';
			
			if (ar[i].id == collapse)
			{
					if(ar[i].style.display =='block')
					{
						ar[i].style.display ='none';
					}
					else
					{
						ar[i].style.display ='block';
					};
			};
			if (ar[i].id == expand)
			{
					if(ar[i].style.display =='block')
					{
						ar[i].style.display ='none';
					}
					else
					{
						ar[i].style.display ='block';
					};
			};
			if (ar[i].id == content)
			{
					if(ar[i].style.display =='block')
					{
						ar[i].style.display ='none';
					}
					else
					{
						ar[i].style.display ='block';
					};
			};
			
			
		};
	}
};

