﻿ReqObj = GetXmlHttpObject();

ReqObj.onreadystatechange = RequestState;

function RequestState() 
{ 
	if (ReqObj.readyState==4 || ReqObj.readyState=="complete")
	{ 
		ReqObj = null;
		ReqObj = GetXmlHttpObject();
	} 
};

function AjaxTab4 (id,bid1,bid2,bid3,bid4) {
	
	try
	{
		table = document.createElement("table");
		table.setAttribute("cellSpacing",0);
		table.setAttribute("cellPadding",0);
		table.setAttribute("border",0);
		table.setAttribute("width","100%");
		table.setAttribute("height",310);
		table.className = "border1";
		table.setAttribute("id",id);
				toptable = document.createElement("table");
				toptable.setAttribute("cellSpacing",1);
				toptable.setAttribute("cellPadding",0);
				toptable.setAttribute("border",0);
				toptable.setAttribute("width","100%");
				toptable.setAttribute("id",id+"menu");
				toptbody = document.createElement("tbody");
					toprow = document.createElement("tr");
					toprow.setAttribute("height",22);
						t1 = document.createElement("td");
						t1.setAttribute("id",bid1);t1.table = table;t1.className = "tabclose";
						t1.setAttribute("align","center");
						t1.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);	
													this.table.selected=this.id;
													this.table.setFocus();
												};
						t1.onmouseover = function () {
														if (this.loaded){
														this.table.Content.innerHTML = this.loadedtext;
														}
													 }
						t2 = document.createElement("td");
						t2.setAttribute("align","center");
						t2.setAttribute("id",bid2);	t2.table = table;t2.className = "tabclose";
						t2.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);		
													this.table.selected=this.id;
													this.table.setFocus();
												};
						t2.onmouseover = function () {
														if (this.loaded){
														this.table.Content.innerHTML = this.loadedtext;
														}
													 }
						t3 = document.createElement("td");
						t3.setAttribute("align","center");
						t3.setAttribute("id",bid3);	t3.table = table;   t3.className = "tabclose";
						t3.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);	
													this.table.selected=this.id;
													this.table.setFocus();
													};
						t3.onmouseover = function () {
																if (this.loaded){
																this.table.Content.innerHTML = this.loadedtext;
																}
															 }
						t4 = document.createElement("td");
						t4.setAttribute("align","center");
						t4.setAttribute("id",bid4);	t4.table = table;	t4.className = "tabclose";
						t4.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);		
													this.table.selected=this.id;
													this.table.setFocus();
												};
						t4.onmouseover = function () {
														if (this.loaded){
														this.table.Content.innerHTML = this.loadedtext;
														}
													 }
					toprow.appendChild(t1);
					toprow.appendChild(t2);
					toprow.appendChild(t3);
					toprow.appendChild(t4);
				toptbody.appendChild(toprow);
				toptable.appendChild(toptbody);
		tbody = document.createElement("tbody");
		toprw = document.createElement("tr");
		botrow = document.createElement("tr");
		table.Content = document.createElement("td");
		upmenu = document.createElement("td");
		upmenu.appendChild(toptable);
		table.Content.setAttribute("id","Content");	
		table.Content.setAttribute("valign","top");
		table.Content.className = "tabback";
		table.Content.setAttribute("height","100%");
			toprw.appendChild(upmenu);
			botrow.appendChild(table.Content);
		tbody.appendChild(toprw);	
		tbody.appendChild(botrow);
		table.appendChild(tbody);
			
		table.addreq = function (itemname,text,req) {
			isitem = findObj(itemname);
			isitem.innerHTML = text;
			isitem.req = req;
		}
		table.setFocus = function (itemname) 
		{
			item1 = findObj(bid1);
			item1.className = "tabclose";
			item2 = findObj(bid2);
			item2.className = "tabclose";
			item3 = findObj(bid3);
			item3.className = "tabclose";
			item4 = findObj(bid4);
			item4.className = "tabclose";
			itemfocus = findObj(this.selected);
			itemfocus.className = "tabopen";
		};
		table.selected = bid1;
		table.Request 		= function (requrl,targetOBj,sender) 
							{
								
								this.Content.innerHTML = '<div align="center"><table width="250" height="250"><tr><td height="250" class="text10"><img src="_image/5-1.gif" align="absmiddle"> İsteniyor!...</td></tr></table></div>';
								AjaxRequest.post(
													{
													'url':requrl
													,'onSuccess':function(req){ targetOBj.innerHTML=req.responseText; }
													}
												);

							};

		return table;
	}
	catch(e)
	{
		alert(e);
	}
}

function AjaxTab3 (id,bid1,bid2,bid3) {
	
	try
	{
		table = document.createElement("table");
		table.setAttribute("cellSpacing",0);
		table.setAttribute("cellPadding",0);
		table.setAttribute("border",0);
		table.setAttribute("width",470);
		table.setAttribute("height",310);
		table.className = "border1";
		table.setAttribute("id",id);
				toptable = document.createElement("table");
				toptable.setAttribute("cellSpacing",1);
				toptable.setAttribute("cellPadding",0);
				toptable.setAttribute("border",0);
				toptable.setAttribute("width","100%");
				toptable.setAttribute("id",id+"menu");
				toptbody = document.createElement("tbody");
					toprow = document.createElement("tr");
					toprow.setAttribute("height",22);
						t1 = document.createElement("td");
						t1.setAttribute("id",bid1);t1.table = table;t1.className = "tabopen";
						t1.setAttribute("align","center");
						t1.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);	
													this.table.selected=this.id;
													this.table.setFocus();
												};
						t2 = document.createElement("td");
						t2.setAttribute("align","center");
						t2.setAttribute("id",bid2);	t2.table = table;t2.className = "tabclose";
						t2.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);	
													this.table.selected=this.id;
													this.table.setFocus();
												};
						t3 = document.createElement("td");
						t3.setAttribute("align","center");
						t3.setAttribute("id",bid3);	t3.table = table;t3.className = "tabclose";
						t3.onclick = function () {
													this.loaded = false;
													this.table.Request(this.req,this.table.Content,this);
													this.table.selected=this.id;
													this.table.setFocus();
													};
					toprow.appendChild(t1);
					toprow.appendChild(t2);
					toprow.appendChild(t3);
				toptbody.appendChild(toprow);
				toptable.appendChild(toptbody);
		tbody = document.createElement("tbody");
		toprw = document.createElement("tr");
		botrow = document.createElement("tr");
		table.Content = document.createElement("td");
		upmenu = document.createElement("td");
		upmenu.appendChild(toptable);
		table.Content.setAttribute("id","Content");	
		table.Content.setAttribute("valign","Top");
		table.Content.className = "tabback";
		table.Content.setAttribute("height","100%");
			toprw.appendChild(upmenu);
			botrow.appendChild(table.Content);
		tbody.appendChild(toprw);	
		tbody.appendChild(botrow);
		table.appendChild(tbody);
			
		table.addreq = function (itemname,text,req) {
			isitem = findObj(itemname);
			isitem.innerHTML = text;
			isitem.req = req;
		}
		table.setFocus = function (itemname) 
		{
			item1 = findObj(bid1);
			item1.className = "tabclose";
			item2 = findObj(bid2);
			item2.className = "tabclose";
			item3 = findObj(bid3);
			item3.className = "tabclose";
			itemfocus = findObj(this.selected);
			itemfocus.className = "tabopen";
		};
		table.selected = bid1;
		table.Request 		= function (requrl,targetOBj,sender) 
							{
								/*plist = new Array();
								for (property in this) { plist[plist.length] = String(property)};
								alert(plist);*/
								this.Content.innerHTML = '<div align="center"><table width="250" height="250"><tr><td height="250" class="text10"><img src="_image/5-1.gif" align="absmiddle"> İsteniyor!...</td></tr></table></div>';
								AjaxRequest.post(
													{
													'url':requrl
													,'onSuccess':function(req){ targetOBj.innerHTML=req.responseText; sender.loaded = true; }
													}
												);

							};

		return table;
	}
	catch(e)
	{
		alert(e);
	}
}

function AjaxTab2 (id,bid1,bid2) {
	
	try
	{
		table = document.createElement("table");
		table.setAttribute("cellSpacing",0);
		table.setAttribute("cellPadding",0);
		table.setAttribute("border",0);
		table.setAttribute("width",470);
		table.setAttribute("height",310);
		table.className = "border1";
		table.setAttribute("id",id);
				toptable = document.createElement("table");
				toptable.setAttribute("cellSpacing",0);
				toptable.setAttribute("cellPadding",0);
				toptable.setAttribute("border",0);
				toptable.setAttribute("width","100%");
				toptable.setAttribute("id",id+"menu");
				toptbody = document.createElement("tbody");
					toprow = document.createElement("tr");
					toprow.setAttribute("height",22);
						t1 = document.createElement("td");
						t1.setAttribute("id",bid1);t1.table = table;t1.className = "tabopen";
						t1.setAttribute("align","center");
						t1.onclick = function () {
													this.table.Request(this.req,this.table.Content);	
													this.table.selected=this.id;
													this.table.setFocus();
												};
						t2 = document.createElement("td");
						t2.setAttribute("align","center");
						t2.setAttribute("id",bid2);	t2.table = table;t2.className = "tabclose";
						t2.onclick = function () {
													this.table.Request(this.req,this.table.Content);	
													this.table.selected=this.id;
													this.table.setFocus();
												};
					toprow.appendChild(t1);
					toprow.appendChild(t2);
				toptbody.appendChild(toprow);
				toptable.appendChild(toptbody);
		tbody = document.createElement("tbody");
		toprw = document.createElement("tr");
		botrow = document.createElement("tr");
		table.Content = document.createElement("td");
		upmenu = document.createElement("td");
		upmenu.appendChild(toptable);
		table.Content.setAttribute("id","Content");	
		table.Content.className = "tabback";
		table.Content.setAttribute("height","100%");
			toprw.appendChild(upmenu);
			botrow.appendChild(table.Content);
		tbody.appendChild(toprw);	
		tbody.appendChild(botrow);
		table.appendChild(tbody);
			
		table.addreq = function (itemname,text,req) {
			isitem = findObj(itemname);
			isitem.innerHTML = text;
			isitem.req = req;
		}
		table.setFocus = function (itemname) 
		{
			item1 = findObj(bid1);
			item1.className = "tabclose";
			item2 = findObj(bid2);
			item2.className = "tabclose";
			itemfocus = findObj(this.selected);
			itemfocus.className = "tabopen";
		};
		table.selected = bid1;
		table.Request 		= function (requrl,targetOBj) 
							{
								/*plist = new Array();
								for (property in this) { plist[plist.length] = String(property)};
								alert(plist);*/
								this.Content.innerHTML = '<div align="center"><table width="250" height="250"><tr><td height="250" class="text10"><img src="_image/5-1.gif" align="absmiddle"> İsteniyor!...</td></tr></table></div>';
								AjaxRequest.post(
													{
													'url':requrl
													,'onSuccess':function(req){ targetOBj.innerHTML=req.responseText; }
													}
												);

							};

		return table;
	}
	catch(e)
	{
		alert(e);
	}
}

function AjaxTab1 (id,bid1,wi) {
	
	try
	{
		table = document.createElement("table");
		table.setAttribute("cellSpacing",0);
		table.setAttribute("cellPadding",0);
		table.setAttribute("border",0);
		table.setAttribute("width",wi);
		table.setAttribute("height",310);
		table.className = "border1";
		table.setAttribute("id",id);
				toptable = document.createElement("table");
				toptable.setAttribute("cellSpacing",0);
				toptable.setAttribute("cellPadding",0);
				toptable.setAttribute("border",0);
				toptable.setAttribute("width","100%");
				toptable.setAttribute("id",id+"menu");
				toptbody = document.createElement("tbody");
					toprow = document.createElement("tr");
					toprow.setAttribute("height",22);
						t1 = document.createElement("td");
						t1.setAttribute("id",bid1);t1.table = table;t1.className = "tabclose";
						t1.setAttribute("align","center");
						t1.onclick = function () {
													this.table.Request(this.req,this.table.Content);	
													this.table.selected=this.id;
													this.table.setFocus();
												};
	
					toprow.appendChild(t1);

				toptbody.appendChild(toprow);
				toptable.appendChild(toptbody);
		tbody = document.createElement("tbody");
		toprw = document.createElement("tr");
		botrow = document.createElement("tr");
		table.Content = document.createElement("td");
		upmenu = document.createElement("td");
		upmenu.appendChild(toptable);
		table.Content.setAttribute("id","Content");	
		table.Content.setAttribute("valign","top");
		table.Content.className = "tabback";
		table.Content.setAttribute("height","100%");
			toprw.appendChild(upmenu);
			botrow.appendChild(table.Content);
		tbody.appendChild(toprw);	
		tbody.appendChild(botrow);
		table.appendChild(tbody);
			
		table.addreq = function (itemname,text,req) {
			isitem = findObj(itemname);
			isitem.innerHTML = text;
			isitem.req = req;
		}
		table.setFocus = function (itemname) 
		{
			item1 = findObj(bid1);
			item1.className = "tabclose";
			itemfocus = findObj(this.selected);
			itemfocus.className = "tabclose";
		};
		table.selected = bid1;
		table.Request 		= function (requrl,targetOBj) 
							{

								this.Content.innerHTML = '<div align="center"><table width="150" height="250"><tr><td height="250" class="text10" align="center">İsteniyor!...</td></tr></table></div>';
								AjaxRequest.post(
													{
													'url':requrl
													,'onSuccess':function(req){ targetOBj.innerHTML=req.responseText; }
													}
												);

							};

		return table;
	}
	catch(e)
	{
		alert(e);
	}
}

function singleRequest(requrl,targetobj)
{
		objtarget = findObj(targetobj)
		objtarget.innerHTML = '<div align="center"><table width="250" height="250"><tr><td height="250" class="text10" align="center"><img src="_image/5-1.gif" align="absmiddle"> İsteniyor!...</td></tr></table></div>';
		AjaxRequest.post(
							{
							'url':requrl
							,'onSuccess':function(req){ objtarget.innerHTML=req.responseText; }
							}
						);
}

function timedRequest(requrl,targetobj)
{
	var t=setTimeout("singleRequest('"+requrl+"','"+targetobj+"')",1000);
}

