//==============================  ===================
function open_tag(tag){
	tag.style.display="inline";
  p_arrow=document.getElementById("p"+tag.id);
  if(p_arrow) p_arrow.className="arrow-open"; 
}
function close_tag(tag){
	tag.style.display="none";
  p_arrow=document.getElementById("p"+tag.id);
  if(p_arrow) p_arrow.className="arrow-close"; 
}
function ShowTab(tabname,tid,render_tab,onlyone){
	var allDivs=document.getElementsByTagName("div");//.getElementById(tabname)
	var c=allDivs.length;
 	if(render_tab){
 		var mtb=document.getElementById(render_tab).childNodes;
 	 	for(i=0;i<mtb.length;i++){
 	 		if(mtb[i].id=="_"+tid)
 	 	  	mtb[i].className="selected_tab";
 	 	 	else mtb[i].className="";
 	 	}
 	}
 	for(i=0;i<c;i++){
  	if(allDivs[i].getAttribute("name")==tabname){//if(allDivs[i].id!=""){//
  		if(tid=='+'){//open all
  			open_tag(allDivs[i]);
  		}else if(tid=='-'){//close all
  			close_tag(allDivs[i]);
  		}else{
   			if(allDivs[i].id==tid){
   				if(!onlyone&&allDivs[i].style.display=="inline")//to be able close them on second click uncomment all
   				  close_tag(allDivs[i]);
   				else
   					open_tag(allDivs[i]);      	       	
   			}else{
   				if(!onlyone){
   					close_tag(allDivs[i]); 
   				}else{
   			  	if(allDivs[i].style.display=="inline"||allDivs[i].style.display=='')
   			    	close_tag(allDivs[i]);  
   				}			     						  
   			}
   		}
  	}
 	}
}
function SetPicture(img_addr,picn){
	showImage();
	PICNUMBER=picn;
	document.getElementById("mainpicture_plh").src=img_addr;
	scroll(0,220);
}
var current_tab="stockimages";
	function previewLarge(){
		var height = screen.height;
		var width = screen.width;
		var leftpos = (width / 2) - 350;
		var toppos = (height / 2) - 350;
		var prevwin=window.open("show_largeimages.php?cid="+CID+"&picn="+PICNUMBER,null,"location=no,menubar=no,toolbar=no,resizable=yes,width=500,height=400");
		prevwin.moveTo(leftpos,toppos);
		prevwin.focus();
	}
	function sendToFriend(carid){
    window.open("sendtofriend.php?cid="+carid,"_blank","directories=no,height=360,location=no,menubar=no,toolbar=no,width=600");
  }
  function openSticker(){
	var height = screen.height;
		var width = screen.width;
		var leftpos = (width / 2) - 350;
		var toppos = (height / 2) - 300;
		var prevwin=window.open("http://www-5.chrysler.com/vehsuite/dispatch.do?currentState=InventorySearchListResults&st=1%7C351C26BDFA96010CF7E5137938BE0200%7C1155581808254%7C4%7CChrysler%7Cen%24%7Ctrue%24InventorySearchListResults%7CSearchPageBasic%7Ctrue%7C0%24false%7Cfalse%7Cfalse%7C%7C%2436%5E-1%5E-1.0%5E-1%5Efalse%5E-1%5Efalse%5E-1%5Efalse%5E-1%5Efalse%5E-1.0%5E-1.0%5E-1.0%5E-1.0%5E0.0%7C60%5E-1.0%5E-1%5Efalse%5E-1%5Efalse%5E-1%5Efalse%5E-1.0%5E-1.0%5E-1.0%5E-1.0%5E-1.0%5E0.0%7C39%5E-1%5E-1.0%5E-1%5Efalse%5E-1%5Efalse%5E-1%5Efalse%5E-1%5Efalse%5E-1.0%5E-1.0%5E-1.0%5E-1.0%5E-1.0%5E0.0%7C-1.0%7C0.0%7C0.0%7CConventional%7C0.0%24false%7C%7C%24NjI1Mjk%3D%7C%7C%7C%7C%7C%7Ctrue%7Ctrue%7Cfalse%7Ctrue%7Cfalse%7Ctrue%7Cfalse%7Cinventory%7C%7C%24%7C%7Cfalse%7C%24%7C%23%23%23%23%23false%230.0%230.0%7C%7C%7C%7C-1%7C%23%23%23%23%23false%230.0%230.0%7C50%7C0%7Cany%7C%7C%7C62529%7C0%7C%7C%24%24null%7Cnull%7Cnull%242006300&&makeTransition=windowSticker&getWindowSticker=<?=$car->get_param('vin')?>&selectInventoryVehicle=lxch480.062DE^<?=$car->get_param('vin')?>^25265^EER^DGV^-D1^PPK^60641^2006300^0^23020",null,"location=yes,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,width=700,height=600");
		prevwin.moveTo(leftpos,toppos);
		prevwin.focus();
	}
	function openWinStick(){
		var height = screen.height;
		var width = screen.width;
		var leftpos = (width / 2) - 350;
		var toppos = (height / 2) - 300;
		var prevwin=window.open("inventory_pp.php?id="+CID,null,"location=yes,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,width=700,height=600");
		prevwin.moveTo(leftpos,toppos);
		prevwin.focus();
	}
	function open_stockTab(tabid){
  	if(current_tab!=tabid){
  		document.getElementById("stock_"+tabid).style.display="inline";
  		document.getElementById("stock_"+current_tab).style.display="none";
  		document.getElementById(tabid).className="active";//tabid+"-selected";
  		document.getElementById(current_tab).className="";//=current_tab;
  		current_tab=tabid;
  		showFlash('',false);
  		//if(tabid=="stockimages") document.getElementById("vli_link").style.display="inline";
  		//else document.getElementById("vli_link").style.display="none";
  	}
  }
  function showFlash(file,doflash){
		showImage();
  	if(doflash){
  		document.getElementById("picture_placeholder").style.display="none";
  		document.getElementById("flash_placeholder").style.display="block";
  		document.getElementById("flash_placeholder").innerHTML='<object width="320" height="240" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#4,0,0,0"><param name="SRC" value="'+file+'"><param name="quality" value="high"><param name="play" value="true"><embed src="'+file+'" width="320" height="240" quality="high" type="application/x-shockwave-flash"></embed></object>';
  		
  	}else{
  		document.getElementById("picture_placeholder").style.display="block";
  		document.getElementById("flash_placeholder").style.display="none";
  		document.getElementById("flash_placeholder").innerHTML="";
  	}
  }
//-------------------------------------------------------------------------