//ARAMA SONUÇ SAYFASINDAN
function yeniuye_dogrula(form) {
	Ctrl = form.uye_eposta;
	if (Ctrl.value == "" || 
	Ctrl.value.indexOf ('@', 0) == -1 || 
	Ctrl.value.indexOf('.') == -1 ||
	(Ctrl.value.indexOf(' ') != -1))  {
		validatePrompt3 (Ctrl, "E-posta adresinizi girmemiş veya yanlış yazdınız. Lütfen kontrol ediniz.");
	return false;
	}

	Ctrl = form.sifre1;
	if (Ctrl.value == "") {
		validatePrompt3 (Ctrl, "Lütfen şifrenizi yazın.");
		return false;
	}
return true;
}

//---------
function validatePrompt3 (Ctrl, PromptStr) {
	alert (PromptStr)
	Ctrl.focus();
	return false;
}

// -->


function On(src){
		///src.style.cursor = 'hand';
		src.style.border = '1px solid #CCCCCC';		
}
function Off(src){
		///src.style.cursor = 'default';
		src.style.border = '1px solid #FFFFFF';			
}
function tik(src){
		src.children.tags('A')[0].click()
}

function addNum(btn){
	arabul.ad.value+="#" + btn;
	arabul.ad.focus();
}


ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function loadSource(url, layer) {

        if (ns4) {
			var lyr = document.layers[layer]
			lyr.load(url,lyr.clip.width)
        }
        else
			if (ie4) {
				self.bufferFrame.document.location = url;
	         }
}

function loadSourceFinish(layer)
{
	document.all[layer].innerHTML = self.bufferFrame.document.body.innerHTML;
}

var kilit = 0;

anima = new Image(93,29);
ekleok = new Image(93,29);

anima.src = "http://kapak.netkitap.com/sepetekleniyor.gif";
eklesrc = "http://kapak.netkitap.com/sepet.gif";
ekleok.src = "http://kapak.netkitap.com/sepeteklendi.gif";
bekle = 0;

function ekle(UrunID){
	
	eval('eklesrc=document.images.kitap'+UrunID+'.src');
	if(kilit != 1){
		if(eklesrc == ekleok.src){
			alert('Kitap sepetinizde bulunmakta.');
		}
		else{
			eval('document.images.kitap'+UrunID+'.src=anima.src');
			url = 'kitapekledhtml.asp?id=' + UrunID;
				loadSource(url, 'liste');
				kilit = 1;
		}
	}
	else{
		alert('Sepetinze kitap ekleme işlemi sürüyor...');
		bekle = 1;
		url = 'kitapekledhtml.asp?id=' + UrunID;
		loadSource(url, 'liste');
	}
}

function yardimpencere( bm )
{
	mywin = window.open('/hizliyardim.asp', 'win', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=650,height=475' );
	mywin.focus();
}

pic1= new Image(16,16);
pic1.src="http://kapak.netkitap.com/icp.gif";


// AYRINTI SONUÇ SAYFASINDAN
function createAjaxObj()
{
	var httprequest=false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
	{ 
		httprequest=new window.XMLHttpRequest();
///		httprequest.overrideMimeType('text/xml; charset=iso-8859-9'); 
		//if (httprequest.overrideMimeType) httprequest.overrideMimeType('text/xml')
	}
	else if (window.ActiveXObject) // if IE
	{ 
		try
		{
			httprequest=new ActiveXObject("Msxml2.XMLHTTP");
//			httprequest.overrideMimeType('text/xml; charset=iso-8859-9');
		}
		catch (e)
		{
			try
			{
				httprequest=new ActiveXObject("Microsoft.XMLHTTP");
//				httprequest.overrideMimeType('text/xml; charset=iso-8859-9');

			}
			catch (e){}
		}
	}
	return httprequest
}

function showTags(str)
{
xmlHttp=createAjaxObj();//GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var jv_inBookID = document.getElementById("inBookID").value;
var url="http://www.netkitap.com/gettag2.asp";
url=url+"?tagNames="+str+"&toBookID="+jv_inBookID;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged()
{
	
	//if (xmlHttp.readyState<4)
	//{
	//document.getElementById("txtTag").innerHTML="doing..";
	//}
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtTag").innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}  

function addFavoBook(strID,userID,codStr){
    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
	    try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }

	    ajaxRequest.onreadystatechange = function(){
		  if (codStr == "kitap"){
	        if(ajaxRequest.readyState < 4){
			    document.getElementById("favBookResult").style.display = "block";
				document.getElementById("favBookResult").innerHTML = "<table cellpadding=3 cellspacing=1 style='border:1px solid #b8b8b8;background-color:#ffffff;'><tr><td><span style='font-size:8pt;color:#E8190E;padding:5px'>Sakla...</span></table>";
	        }
	        if(ajaxRequest.readyState == 4){
				ajaxText = ajaxRequest.responseText; 
				document.getElementById("favBookResult").innerHTML = ajaxText;
				remind();
				
	        }
			function remind() { 
				var t=setTimeout('document.getElementById("favBookResult").innerHTML = "";document.getElementById("favBookResult").style.display = "none";',3000); 
			}
		  }
		  if (codStr == "yazar"){
	        if(ajaxRequest.readyState < 4){
			    document.getElementById("favBookResult2").style.display = "block";
				document.getElementById("favBookResult2").innerHTML = "<table cellpadding=3 cellspacing=1 style='border:1px solid #b8b8b8;background-color:#ffffff;'><tr><td><span style='font-size:8pt;color:#E8190E;padding:5px'>Sakla...</span></table>";
	        }
	        if(ajaxRequest.readyState == 4){
				ajaxText = ajaxRequest.responseText; 
				document.getElementById("favBookResult2").innerHTML = ajaxText;
				remind2();
				
	        }
			function remind2() { 
				var t=setTimeout('document.getElementById("favBookResult2").innerHTML = "";document.getElementById("favBookResult2").style.display = "none";',3000); 
			}
		  }
		}
		if (codStr == "kitap"){
			ajaxRequest.open("GET", "http://www.netkitap.com/addfavori.asp?jx_kitapID="+strID+"&jx_userID="+userID+"&ms=" + new Date().getTime(),true);
			ajaxRequest.send(null);
		}
		if (codStr == "yazar"){
			ajaxRequest.open("GET", "http://www.netkitap.com/addfavori.asp?jx_yazarID="+strID+"&jx_userID="+userID+"&ms=" + new Date().getTime(),true);
			ajaxRequest.send(null);
		}
}

	function openBigCover(jxBookF,jxBookB,jxLookWhat){
		var ajaxRequest;  // The variable that makes Ajax possible!
		try{
				// Opera 8.0+, Firefox, Safari
				ajaxRequest = new XMLHttpRequest();
		} catch (e){
				// Internet Explorer Browsers
			try{
					ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
			try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
								}
			}
		}
						// Create a function that will receive data sent from the server
		if (jxLookWhat == 0){
        document.getElementById("xBigCoverPrgF").style.display="block";
		document.getElementById("xBigCoverPrgF").innerHTML = "<table style='border:1px solid #404040' bgcolor='#FFFFFF' width=60 height=60><tr><td align='center'><img src='http://kapak.netkitap.com/icp2.gif'></table>";	
		}
		if (jxLookWhat == 1){
        document.getElementById("xBigCoverPrgB").style.display="block";
		document.getElementById("xBigCoverPrgB").innerHTML = "<table style='border:1px solid #404040' bgcolor='#FFFFFF' width=60 height=60><tr><td align='center'><img src='http://kapak.netkitap.com/icp2.gif'></table>";	
		}
		ajaxRequest.onreadystatechange = function(){
			if( ajaxRequest.readyState < 4){
								//document.getElementById("xBigCover").style.display="block";
			}
			if(ajaxRequest.readyState == 4){
			     //$('#xBigCover').Fold("slow","350");
								document.getElementById("xBigCover").innerHTML = ajaxRequest.responseText;
								 //$('#xBigCover').fadeIn("normal");
								//$('#xxBigImageHere').slideDown("slow");
								//$('#xxBigImageHere').DropInLeft(500);
			}
		}
		ajaxRequest.open("GET", "http://www.netkitap.com/go_findBigCover.asp?jxBookF="+jxBookF+"&jxBookB="+jxBookB+"&jxLookWhat="+jxLookWhat+"&ms="+new Date().getTime(),true);
		ajaxRequest.send(null); 
	}
	function CloseBigBook(){
		$('#xBigCover').hide("normal");
	}
	function hideMyPrg(lookFB){
	    $('#xBigCover').fadeIn("normal");
		if (lookFB == 0){
		document.getElementById("xBigCoverPrgF").style.display="none";
		}
		if (lookFB == 1){
		document.getElementById("xBigCoverPrgB").style.display="none";
		}
	}


	function open_vForm(){
		document.getElementById('v_sf').style.display = 'block';
		document.getElementById('b_msg').innerHTML = "";
		document.getElementById('b_mail').style.visibility = 'hidden';
	}
	function close_vForm(){
		document.getElementById('v_sf').style.display = 'none';
		document.getElementById('b_mail').style.visibility = 'visible';
	}

//ortak basbolum

function clearfield1(){
if (document.girisform.uye_eposta.value == "e-postanız")
	document.girisform.uye_eposta.value = "";
}
function clearfield2(){
if (document.girisform.uye_sifre1.value == "şifreniz")
	document.girisform.uye_sifre1.value = "";
}

function openWindow(url,width,height) {
  popupWin = window.open(url,'','width=' + width + ',height=' + height + ',scrollbars=yes')
}

