// JavaScript Document

/*HEADER MENU CONTENTS LOADER FNC*/

	function getPages(url, container){
		$("#"+container).html('<img src="loading.gif" style="margin:10px auto 0px auto;"/>');
		$("#"+container).load(url);
		}
		
/**/

/*SEND FORM*/
	
	function sendForm(whichPage){
		var formCriterias=$(".sendForm").serialize();
		var coordinatesGoogle=window.mapCodes.mapCoordinates;
		var zoomGoogle=window.mapCodes.mapZoom;
		
		$("#GMcode").val(coordinatesGoogle);
		$("#GMzoom").val(zoomGoogle);

		alert($("#GMcode").attr("value"));

		window.open(whichPage+"?"+formCriterias+"&companyLogo="+$("#companylogo").attr("value")+"&companySector="+$("#sektor").attr("value")+"&gorusler="+$("#gorusleriniz").html(),"Uyari","width=500,height=200,left=200,top=200,status=0,resizable=1");
	}

/**/


/*ALLINBOX CONTENT LOADER FNC*/	
	
	 function aibLoad($f){
		 $("#AIBcontents").html('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="443" HEIGHT="252" id="myMovieName"><PARAM NAME=movie VALUE="loading.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><PARAM NAME=wmode VALUE=transparent><EMBED WIDTH="443" HEIGHT="252" ALIGN="" href="/support/flash/ts/documents/loading.swf" quality=high bgcolor=#FFFFFF NAME="loading" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></EMBED></OBJECT>');
		 $("#AIBcontents").load($f);
		 }
	 
	 $(document).ready(function(){aibLoad('allInBox/categories.php')}); // Ilk açilista içerik otomatik yükleniyor...
	 
/**/


/*SEARCH BOX SEARCHING FOR ALL CRITERIAS FNC*/

	function getSearch(){
		var searchCriteria= $("#searchTextBox").attr("value");
		if(searchCriteria=="") window.open("alertNotice.html","Uyari","width=300,height=200,left=200,top=200,status=0"); 
		else if(selectedBtn=="firma") window.location="firma_arama_sonuc.php?q="+searchCriteria;
		else if(selectedBtn=="urun") window.location="urun_arama_sonuc.php?q="+searchCriteria;
		else if(selectedBtn=="ilan") window.location="ilan_arama_sonuc.php?q="+searchCriteria;
	}

/**/

/*ONLY CATEGORY SEARCH FNC ( ON ALLINBOX )*/

	function getSearch2(){
		var searchCriteria2= $("#catSearchBox").attr("value");
		if(searchCriteria2=="") window.open("alertNotice.html","Uyari","width=300,height=200,left=200,top=200,status=0");
		else window.location="firma_arama_sonuc.php?q="+searchCriteria2;
	}

/**/

/*ONLY COMPANY SEARCH FNC ( ON ALLINBOX )*/

	function getSearch3(){
		var searchCriteria3= $("#comSearchBox").attr("value");
		if(searchCriteria3=="" ) window.open("alertNotice.html","Uyari","width=300,height=200,left=200,top=200,status=0"); 
		else window.location="firma_arama_sonuc.php?q="+searchCriteria3;
	}

/**/

/*ONLY NOTICES SEARCH FNC ( ON ALLINBOX )*/

	function getSearch4(){
		var searchCriteria4= $("#catSearchBox").attr("value");
		if(searchCriteria4=="" ) window.open("alertNotice.html","Uyari","width=300,height=200,left=200,top=200,status=0"); 
		else window.location="ilan_arama_sonuc.php?q="+searchCriteria4;
	}

/**/

/*SEND EMAIL FNC ( ON ALLINBOX )*/

	function getSearch5(){
		var searchCriteria5= $("#EBinput").attr("value");
		if(searchCriteria5=="" ) window.open("alertMailNotice.html","Uyari","width=300,height=200,left=200,top=200,status=0");
		else window.open("save_email.php?q="+searchCriteria5,"Uyari","width=500,height=200,left=200,top=200,status=0");
		
		
	}

/**/


/*SEND EMAIL TO COMPANY FROM "COMPANY PAGE FORM" */

	function sendMailToCompany(companyID){
		var mailContents=$("#smtc").serialize();
		mailContents=mailContents+"&gorusler="+$("#gorusler").text();
		mailContents=mailContents+"&companyID="+companyID;

        window.open("sendMailToCompany.php?"+mailContents,"Uyari","width=500,height=200,left=200,top=200,status=0");
			
	}

/**/


/*SEND EMAIL TO NOTICE FROM "NOTICE PAGE FORM" */

	function sendMailToNotice(companyID){
		var mailContents=$("#smtc").serialize();
		mailContents=mailContents+"&gorusler="+$("#gorusler").text();
		mailContents=mailContents+"&companyID="+companyID;

        window.open("sendMailToNotice.php?"+mailContents,"Uyari","width=500,height=200,left=200,top=200,status=0");
			
	}

/**/


/*SEND EMAIL TO US "CONTACT PAGE FORM" */

	function sendMailToUs(){
		var mailContents=$("#smtc").serialize();
		mailContents=mailContents+"&gorusler="+$("#gorusler").text();

        window.open("send_contact.php?"+mailContents,"Uyari","width=500,height=200,left=200,top=200,status=0");
			
	}

/**/


