function imageNewsSRC(path){

	document.getElementById('picL').src ="../cms/data/news/popup/l/"+path;
}


/*function showToolTip(e,text){
	var txt='<img src="http://www.boonthavorn.com//'+text+'"/>';
	//alert(txt)
	if(document.all)e = event;
	var obj = parent.document.getElementById('bubble_tooltip');
	var obj2 = parent.document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = txt;
	obj.style.display = 'block';
	var st = Math.max(parent.document.body.scrollTop,parent.document.documentElement.scrollTop);
	var ft=parent.document.getElementById('ifooter');
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = e.clientX +8;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	if(st>0){
		if(navigator.appName == "Microsoft Internet Explorer"){
			obj.style.top = e.clientY - obj.offsetHeight  + ft.offsetTop - st - 8 + 'px';
		}else{
			obj.style.top = e.clientY - obj.offsetHeight  + ft.offsetTop - st + 8 + 'px';
		}
	}else{
		if(navigator.appName == "Microsoft Internet Explorer"){
			obj.style.top = e.clientY - obj.offsetHeight  + ft.offsetTop + st - 8 + 'px';
		}else{
			obj.style.top = e.clientY - obj.offsetHeight  + ft.offsetTop + st + 5 + 'px';
		}
	}
}	

function hideToolTip()
{
	parent.document.getElementById('bubble_tooltip').style.display = 'none';
	
}
*/
function changeStore(id){
	for(i=1;i<8;i++){
		document.getElementById('store'+i).style.display = 'none';
	}
	document.getElementById('store'+id).style.display = 'block';
}
/* for footer*/
function masterFunc(queryStr){
			  				  
				  $('#masterReponse').hide();
				  $('#form1').hide();
				  $('#masterLoading').show();	

				  enews=$('#enews').val();
				  //alert(text1)

if(!queryStr)
{
		 queryStr="enews="+enews;				  	
 } 
   //alert(queryStr);
  
				  $.ajax({
					   type: "POST",
					   url: "/boonthavorn/boonthavorn/lib/add_enew.php",
					   cache: false,
					   data: queryStr,
					   success: function(response){
						 setTimeout("finishMaster('masterReponse', '"+escape(response)+"')", 500);
					   }
					 });
}
function finishMaster(id, response) {
  $('#masterLoading').hide();
  document.form1.enews.value=unescape(response);
  $('#form1').fadeIn();
  //$('#'+id).html(unescape(response));
  //$('#'+id).fadeIn();
}
/* end footer*/
function changePic(txt,id,type){
		if(type=='pic'){
				document.getElementById(id).innerHTML = '<img src="'+txt+'" border="0">';
		}
		if(type=='vdo'){
		var s1 = new SWFObject("http://203.155.18.15/lib/mediaplayer.swf","http://203.155.18.15/lib/mediaplayer","760","360","8");
		s1.addParam("allowfullscreen","true");
		s1.addParam("allowscriptaccess","always");
		s1.addVariable("autostart","true");
		s1.addVariable("width","760");
		s1.addVariable("height","360");
		s1.addVariable("file",txt);
		s1.write(id);
		}
}


function fnSearch(queryStr){
	if(queryStr!=""){			  				  
		/*$('#searchReponse').show();*/
		queryStr="inputSearch="+queryStr;				  	
  
		 $.ajax({
		   type: "POST",
		   url: "../lib/search.php",
		   cache: false,
		   data: queryStr,
		   success: function(response){
		     finishAjax('searchReponse', escape(response));
		   }
		  });
	}else{
			$('#searchReponse').hide();
	}
}

function finishAjax(id, response) {
  if(response.length>975){
  	$('#'+id).html(unescape(response));
  	$('#'+id).show();
  }
}


function storePrint(){
  var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; 
      disp_setting+="scrollbars=yes,width=815, height=815, left=100, top=25"; 
  var content_A= document.getElementById("ColumnRight").innerHTML;
  var divHide="'displayFuntions'";
  var divHide2="'storeDisplayRight'";
  var show="'none'";

  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>บุญถาวร - IDEAS NEVER END</title>'); 
   docprint.document.write('<link href="../css/global.css" rel="stylesheet" type="text/css" /><link href="../css/store.css" rel="stylesheet" type="text/css" /></head><body onLoad="document.getElementById('+divHide+').style.display='+show+';document.getElementById('+divHide2+').style.display='+show+';self.print();" style="margin-left:20px;margin-top:20px;">');
   docprint.document.write('<div style="padding-bottom:10px;"><img src="../engine/global/logoBoonthavorn.gif" alt="บุญถาวร" border="0" /></div>');
   docprint.document.write(content_A);
   docprint.document.write('<div style="font-size:0.7em;">© สงวนลิขสิทธิ์ 2550-2552 บริษัท บุญถาวรเซรามิค จำกัด</div>');
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 

}
function newsPrint(){
  var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; 
          disp_setting+="scrollbars=yes,width=815, height=815, left=100, top=25"; 
  var content_A= document.getElementById("ColumnRight").innerHTML;
  var divHide="'displayFuntions'";
  var divHide2="'newsMore'";
  var show="'none'";

  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>บุญถาวร - IDEAS NEVER END</title>'); 
   docprint.document.write('<link href="../css/global.css" rel="stylesheet" type="text/css" /><link href="../css/news.css" rel="stylesheet" type="text/css" /></head><body onLoad="document.getElementById('+divHide+').style.display='+show+';document.getElementById('+divHide2+').style.display='+show+';self.print();" style="margin-left:20px;margin-top:20px;">');
   docprint.document.write('<div style="padding-bottom:10px;"><img src="../engine/global/logoBoonthavorn.gif" alt="บุญถาวร" border="0" /></div>');
   docprint.document.write(content_A);
   docprint.document.write('<div class="clear-all"></div><div style="font-size:0.7em;">© สงวนลิขสิทธิ์ 2550-2552 บริษัท บุญถาวรเซรามิค จำกัด</div>');
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 

}

function contactPrint(){
  var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; 
          disp_setting+="scrollbars=yes,width=817, height=790, left=100, top=25"; 
  var content_A= document.getElementById("ColumnRight").innerHTML;
  var divHide="'displayFuntions'";
  var show="'none'";
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>บุญถาวร - IDEAS NEVER END</title>'); 
   docprint.document.write('<link href="../css/global.css" rel="stylesheet" type="text/css" /><link href="../css/contact.css" rel="stylesheet" type="text/css" /></head><body onLoad="document.getElementById('+divHide+').style.display='+show+';self.print();" style="margin-left:20px;margin-top:20px;margin-right:20px;">');
   docprint.document.write('<div style="padding-bottom:10px;"><img src="../engine/global/logoBoonthavorn.gif" alt="บุญถาวร" border="0" /></div>');
   docprint.document.write(content_A);
   docprint.document.write('<div style="font-size:0.7em;">© สงวนลิขสิทธิ์ 2550-2552 บริษัท บุญถาวรเซรามิค จำกัด</div>');
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 

}

function promotionPrint(){
  var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; 
          disp_setting+="scrollbars=yes,width=817, height=790, left=100, top=25"; 
  var content_A= document.getElementById("ColumnRight").innerHTML;
  var divHide="'promotionDisplayWrapper'";
  var show="'none'";
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>บุญถาวร - IDEAS NEVER END</title>'); 
   docprint.document.write('<link href="../css/global.css" rel="stylesheet" type="text/css" /><link href="../css/promotion.css" rel="stylesheet" type="text/css" /></head><body onLoad="document.getElementById('+divHide+').style.display='+show+';self.print();" style="margin-left:20px;margin-top:20px;margin-right:20px;">');
   docprint.document.write('<div style="padding-bottom:10px; width:100%;text-align:right;"><img src="../engine/global/logoBoonthavorn.gif" alt="บุญถาวร" border="0" /></div>');
   docprint.document.write(content_A);
   docprint.document.write('<div style="font-size:0.7em;">© สงวนลิขสิทธิ์ 2550-2552 บริษัท บุญถาวรเซรามิค จำกัด</div>');
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 

}

function jobPrint(id){
  var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; 
          disp_setting+="scrollbars=yes,width=815, height=815, left=100, top=25"; 
  var content_A=document.getElementById("li"+id).innerHTML;
  var txtreplace="showJobdetail('"+id+"');";
  var content_B= content_A.replace(txtreplace,"");
  var	jobDetail= content_B.replace(txtreplace,"");
  var divHide="'displayFuntions'";
  var divHide2="'btnApp'";
  var show="'none'";

  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>บุญถาวร - IDEAS NEVER END</title>'); 
   docprint.document.write('<link href="http://www.boonthavorn.com//css/global.css" rel="stylesheet" type="text/css" /><link href="http://www.boonthavorn.com//css/hr.css" rel="stylesheet" type="text/css" /></head><body onLoad="document.getElementById('+divHide+').style.display='+show+';document.getElementById('+divHide2+').style.display='+show+';self.print();" style="margin-left:20px;margin-top:20px;">');
   docprint.document.write('<div style="padding-bottom:10px;"><img src="../engine/global/logoBoonthavorn.gif" alt="บุญถาวร" border="0" /></div>');
   docprint.document.write('<div id="ColumnRight"><div id="PositionList"><ul><li>');
   docprint.document.write(jobDetail);
   docprint.document.write('</li></ul></div></div>');
   docprint.document.write('<div style="clear:both;font-size:0.7em;">© สงวนลิขสิทธิ์ 2550-2552 บริษัท บุญถาวรเซรามิค จำกัด</div>');
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 

}

function tooltipStore(e,a,sname){
		var myimg='';
		if(a==1){
				myimg='<img src="../engine/global/tool_icon03.gif" style="position:absolute; margin-top:5px;left:35px;">  คลิกเพื่อดูแผนที่';
		}else if(a==2){
				myimg='<img src="../engine/global/tool_icon01.gif" style="position:absolute; margin-top:5px;left:15px;">  เลือกชมภาพบรรยากาศ';
		}else{
				myimg='<img src="../engine/global/tool_icon02.gif" style="position:absolute; margin-top:5px;left:15px;">  เลือกชมวีดีโอบรรยากาศ';
		}
		var txt='<img src="http://www.boonthavorn.com//'+text+'"/>';
		if(document.all)e = event;
		
		var obj = document.getElementById('storetooltip');
		var obj2 = document.getElementById('storeTitle');
		var obj3 = document.getElementById('storeContent');
		obj2.innerHTML = myimg;
		obj3.innerHTML = sname;
		obj.style.display = 'block';
		var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
		var sw = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
		if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
		obj.style.left = e.clientX - 30 + 'px'
		obj.style.top = e.clientY + 15 + 'px';
}
function tooltipStoreHide()
{
	document.getElementById('storetooltip').style.display = 'none';
	
}

function showProductDetail(){
		var show=document.getElementById('moreDetail').style.display;
		if(show!='none'){
				document.getElementById('btnMore').style.background='url(../engine/global/crumbArrw.gif) no-repeat 65px center;';
				document.getElementById('moreDetail').style.display='none';
		}else{
				document.getElementById('btnMore').style.background='url(../engine/global/arrwMore.gif) no-repeat 65px center;';
				document.getElementById('moreDetail').style.display='';
		}
		//arrwMore.gif btnMore
}

function showProductBanner(id,allbanner){
	for(i=1;i<allbanner;i++){
		document.getElementById('productBanner'+i).style.display='none';
	}
	document.getElementById('productBanner'+id).style.display='';
}
function showProductBannerSlide(id,allbanner){
	for(i=1;i<allbanner;i++){
		if(i!=id){
			if(document.getElementById('productBanner'+i).style.display!='none'){
				$('#productBanner'+id).fadeOut(200)
			}
			//document.getElementById('productBanner'+i).style.display='none';
		}
	}
	$('#productBanner'+id).fadeIn(200);
	//document.getElementById('productBanner'+id).style.display='';
}