function ajax(url, containerid,variables)
{
	setTimeout("ajax2('"+url+"','"+containerid+"','"+variables+"')",1000);
}

function ajax2(url, containerid,variables){

	var page_request = false

try {
page_request = new ActiveXObject("Microsoft.XMLHTTP"); // eski versiyon xmlhttp
} catch (e) {
page_request = false;
}
	
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP"); // yeni versiyon xmlhttp
} catch (e) {
}

// Mozilla ve Safari
if ( !page_request && typeof XMLHttpRequest != 'undefined' ) {

try{
page_request = new XMLHttpRequest();
}catch(e) { 
page_request = false;
}

}

// Diger
if ( !page_request && window.createRequest ) {

try{
page_request = window.createRequest();
} catch(e) { 
page_request = false;
}

}

	page_request.onreadystatechange=function(){loadpage(page_request, containerid, url)}
	page_request.open('GET', url + '&random=' + Math.random(), true)
	page_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=iso-8859-9")
	page_request.send(null)}


   function loadpage(page_request, containerid, url){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	{
	document.getElementById(containerid).innerHTML=page_request.responseText;
	
	if (page_request.readyState == 4 && page_request.status==200 && containerid=='dvProductsPageProductsCombo')
	{
	path=document.getElementById('comboMark');
	if (url.indexOf("id")!=-1);
	{
	for (var i=1;i<= path.length;i++)
	{
	var	str=url;
	str=str.replace(Left(str,str.indexOf("id")+3),'');
	try
	{
	if (path.options[i].value==eval(str)) {path.options[i].selected=true;}
	}
	catch(err)
	{
	}
	}
	}
	}
	
	
	
	}
	}
	
///////////////////////////////////////////////////////////////////////////////////////////////////////////	
	
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
	
///////////////////////////////////////////////////////////////////////////////////////////////////////////

timers = new Array();    
oldSetTimeout = window.setTimeout;    

window.setTimeout = function(code, interval) 
{      
timers.push(oldSetTimeout(code, interval));    
}        

function resetTimeouts() 
{      
timers = new Array();    
}   

function clearTimeouts() 
{      
for (var i= 0;i < timers.length; i++) {        
clearTimeout(timers[i]);      
}      
resetTimeouts();    
}

//////////////////////AJAX İLE ÇAĞIRILAN SAYFALARDA ÇALIŞACAK Javascript Kodları///////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////
var resimlerx = new Array
resimlerx[1]='images/products/wesse.jpg';
resimlerx[2]='images/products/dockers.jpg';

var resimlerx_over = new Array
resimlerx_over[1]='images/products/wesse_over.jpg';
resimlerx_over[2]='images/products/dockers_over.jpg';

function overx(id)
{
path=document.getElementById('imgx'+id);	
path.src=resimlerx_over[id];	
}

function outx(id)
{
path=document.getElementById('imgx'+id);	
path.src=resimlerx[id];
}

function clSlider()
{
	try
	{
path=document.getElementById('leftArrow');
path.src='images/products/left_arrow.jpg';
path=document.getElementById('rightArrow');
path.src='images/products/right_arrow.jpg';
	}
	catch(err)
	{}
	
		try
	{
path=document.getElementById('downArrow');
path.src='images/down_arrow.jpg';
path=document.getElementById('upArrow');
path.src='images/up_arrow.jpg';

	}
	catch(err)
	{}

clearTimeouts();
}

function sola()
{
path=document.getElementById('leftArrow');
path.src='images/products/left_arrow_over.jpg';
setTimeout("sola2()");
}

function saga()
{
path=document.getElementById('rightArrow');
path.src='images/products/right_arrow_over.jpg';
setTimeout("saga2()");
}

function asagi()
{
path=document.getElementById('downArrow');
path.src='images/down_arrow.jpg';
setTimeout("asagi2()");
}

function yukariSlider(obj)
{
	obj.detachEvent('onmousemove',asagiSlider2);
}

function asagi2()
{
	path=document.getElementById('mycustomscroll');
	path2=document.getElementById('overflowSlider');
	var psh=eval(path.scrollHeight);
	oran=(220*10)/(psh-220);
	if(eval(path2.style.top.replace("px",""))<220 && eval(path2.style.top.replace("px",""))>0) 
	{
	path.scrollTop=path.scrollTop+10;
	path2.style.top=eval(path2.style.top.replace("px",""))+Math.round(oran)+"px";
	}
	else
	{
	path2.style.top="220px";	
	path.scrollTop=psh-220;
	}
	
	
	setTimeout("asagi2()");
}

function yukari()
{
path=document.getElementById('upArrow');
path.src='images/up_arrow.jpg';
setTimeout("yukari2()");
}

function yukari2()
{
	path=document.getElementById('mycustomscroll');
	path2=document.getElementById('overflowSlider');
	var psh=eval(path.scrollHeight);
	oran=(220*10)/(psh-220);
	if(path.scrollTop>0) 
	{
	path.scrollTop=path.scrollTop-10;
	if(eval(path2.style.top.replace("px",""))>0)
	{
	path2.style.top=eval(path2.style.top.replace("px",""))-Math.round(oran)+"px";
	}
	}
	else
	{
	path2.style.top="1px";	
	}
	
	if(path2.style.top<0) {path2.style.top="0px";}
	
	setTimeout("yukari2()");
	
}


function saga2()
{
path=document.getElementById('canSlider');
	try
	{
	path.scrollLeft=path.scrollLeft+2;
	}
	catch(err)
	{}
	setTimeout("saga2()");
}

function sola2()
{
	path=document.getElementById('canSlider');
	try
	{
	path.scrollLeft=path.scrollLeft-2;
	}
	catch(err)
	{}
	setTimeout("sola2()");
}

function urundetaygetir(id,markid)
{
if (id!=0)
{
ajax('tempProductTxt.asp?abc=abc','dvHomePageProductTxt','');
ajax('tempProductPic.asp?abc=abc','dvHomePageProductPic','');
urundetaygetir2(id,markid);
}
}

function urundetaygetir2(id,markid)
{
ajax('getProductsPageCombo.asp?abc=abc&mark2='+markid+'&id='+id+'','dvProductsPageProductsCombo','');
ajax('getProductsPageProductDetail.asp?abc=abc&id='+id+'','dvHomePageProductTxt','');
ajax('getProductsPageProductPicDetail.asp?abc=abc&id='+id+'','dvHomePageProductPic','');
}