//Identifying the Country Code and Language Code Starts here
//?cntry_cd=SA&lang_cd=en
var omni_langCd="en";
var ctryCd="";
var formAlert="This service is not yet available in Iraq";
if(location.href.indexOf("/action/")>0) // Shop & Buy tool
{
	var xloc=location.href;
	if(xloc.indexOf("newPage=")>0) ctryCd=xloc.substr(xloc.indexOf("newPage=")+8,2); // For Optin Form
	else if(xloc.indexOf("cntry_cd=")>0)
	{
		if(xloc.substr(xloc.indexOf("cntry_cd=")+9,2)!="ME")
			ctryCd=xloc.substr(xloc.indexOf("cntry_cd=")+9,2); // For CIF
		else
			ctryCd=xloc.substr(xloc.indexOf("cntryCd=")+8,2); // For Contact Us
	}
	else if(xloc.indexOf("cntryCd=")>0) ctryCd=xloc.substr(xloc.indexOf("cntryCd=")+8,2); // For Contact Us	
}
else // Static page
{
	var xloc=location.href;
	if(xloc.indexOf("cntryCd=")>0) ctryCd=xloc.substr(xloc.indexOf("cntryCd=")+8,2);
}

function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images)
  { 
  	if(!d.MM_p) d.MM_p=new Array();
    var i,
	j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0)
		{ 
		d.MM_p[j]=new Image; 
		d.MM_p[j++].src=a[i];
		}
	}
}
// code incorparted for dynamic menu population
function leftNav()
{
	/*if (ctryCd != 'IQ')
	{
	document.write("<table width='150' border='0' cellpadding='0' cellspacing='0' dwcopytype='CopyTableRow'>"+
	"          <tr> "+
	"            <td><a href='#'><img src='../images/menu_company.gif' border='0' width='150' height='19'></a></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(9,'N') onMouseOver=MM_swapImage('vision','','../images/left_nav_vision1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_vision.gif' name='vision' width='150' height='19' border='0' id='vision'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(10,'N') onMouseOver=MM_swapImage('gmme','','../images/left_nav_GMMEhist1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_GMMEhist.gif' name='gmme' width='150' height='19' border='0' id='gmme'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(11,'N') onMouseOver=MM_swapImage('news','','../images/left_nav_news1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_news.gif' name='news' width='150' height='19' border='0' id='news'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(12,'N') onMouseOver=MM_swapImage('gmdiff','','../images/left_nav_gmDifference1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_gmDifference.gif' name='gmdiff' width='150' height='19' border='0' id='gmdiff'></a></td>"+
	"                </tr>"+
	"              </table></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><a href='#' onMouseOver='MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide','testDrive','','hide','Brochure','','hide')'><img src='../images/menu_automotive.gif' width='150' height='19' border='0'></a></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:showroomCountry() onMouseOver=MM_swapImage('showroom','','../images/left_nav_showroom1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_showroom.gif' name='showroom' width='150' height='19' border='0' id='showroom'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'> <a href=javascript:dealerLocatorCountry() onMouseOver=MM_swapImage('dealer','','../images/left_nav_locator1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_locator.gif' name='dealer' width='150' height='19' border='0' id='dealer'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(13,'N') onMouseOver=MM_swapImage('fleet','','../images/left_nav_fleet1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_fleet.gif' name='fleet' width='150' height='19' border='0' id='fleet'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(14,'N')><img src='../images/left_nav_usedCars.gif' name='usedcars' width='150' height='19' border='0' id='usedcars' onMouseOver=MM_swapImage('usedcars','','../images/left_nav_usedCars1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td height='17' rowspan='2'>&nbsp;</td>"+
	"                  <td><a href=javascript:goto(18,'N')><img src='../images/left_nav_safety.gif' name='safety' width='150' height='19' border='0' id='safety' onMouseOver=MM_swapImage('safety','','../images/left_nav_safety1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"                <tr> </tr>"+
	"              </table></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><a href='#' onMouseOver='MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide','testDrive','','hide','Brochure','','hide')'><img src='../images/menu_beyond.gif' width='150' height='19' border='0'></a></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
	"                "+
	"                <tr> "+
	"                  <td width='10' height='14'><img src='images/spacer.gif' height='7' width='1'></td>"+
	"                  <td><a href=javascript:goto(16,'N') onMouseOver=MM_swapImage('gmlink','','images/left_nav_gmlink1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='images/left_nav_gmlink.gif' name='gmlink' width='150' height='19' border='0' id='gmlink'></a></td>"+
	"                </tr>"+
	"				<tr> "+
	"                  <td width='10'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td><a href=javascript:goto(17,'N') onMouseOver=MM_swapImage('fun','','../images/left_nav_entertainment1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_entertainment.gif' name='fun' width='150' height='19' border='0' id='fun'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td height='18'>&nbsp;</td>"+
	"                  <td><a href=javascript:bookTestdriveCountry() onMouseOver=MM_swapImage('book','','../images/left_nav_bookTestdrive1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_bookTestdrive.gif' name='book' width='150' height='19' border='0' id='book'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td height='18'>&nbsp;</td>"+
	"                  <td><a href=javascript:reqBrochureCountry()><img src='../images/left_nav_reqBrochure.gif' name='request1' width='150' height='19' border='0' id='request' onMouseOver=MM_swapImage('request1','','../images/left_nav_reqBrochure1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td height='18'>&nbsp;</td>"+
	"                  <td><a href=javascript:goto(20,'N')><img src='../images/left_nav_updated.gif' name='upload1' width='150' height='19' border='0' id='upload' onMouseOver=MM_swapImage('upload1','','../images/left_nav_updated1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"              </table></td>"+
	"          </tr>"+
	"        </table>");
	}
	else{*/
		document.write("<table width='150' border='0' cellpadding='0' cellspacing='0' dwcopytype='CopyTableRow'>"+
	"          <tr> "+
	"            <td><a href='#'><img src='../images/menu_company.gif' border='0' width='150' height='19'></a></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(9,'N') onMouseOver=MM_swapImage('vision','','../images/left_nav_vision1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_vision.gif' name='vision' width='150' height='19' border='0' id='vision'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(10,'N') onMouseOver=MM_swapImage('gmme','','../images/left_nav_GMMEhist1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_GMMEhist.gif' name='gmme' width='150' height='19' border='0' id='gmme'></a></td>"+
	"                </tr>"+
	"                <tr style='display:none'> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(11,'N') onMouseOver=MM_swapImage('news','','../images/left_nav_news1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_news.gif' name='news' width='150' height='19' border='0' id='news'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(12,'N') onMouseOver=MM_swapImage('gmdiff','','../images/left_nav_gmDifference1.gif',1);MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide') onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_gmDifference.gif' name='gmdiff' width='150' height='19' border='0' id='gmdiff'></a></td>"+
	"                </tr>"+
	"              </table></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><a href='#' onMouseOver='MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide','testDrive','','hide','Brochure','','hide')'><img src='../images/menu_automotive.gif' width='150' height='19' border='0'></a></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:showroomCountry() onMouseOver=MM_swapImage('showroom','','../images/left_nav_showroom1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_showroom.gif' name='showroom' width='150' height='19' border='0' id='showroom'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'> <a href=javascript:dealerLocatorCountry() onMouseOver=MM_swapImage('dealer','','../images/left_nav_locator1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_locator.gif' name='dealer' width='150' height='19' border='0' id='dealer'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(13,'N') onMouseOver=MM_swapImage('fleet','','../images/left_nav_fleet1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_fleet.gif' name='fleet' width='150' height='19' border='0' id='fleet'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td width='5%' height='18'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td width='95%'><a href=javascript:goto(14,'N')><img src='../images/left_nav_usedCars.gif' name='usedcars' width='150' height='19' border='0' id='usedcars' onMouseOver=MM_swapImage('usedcars','','../images/left_nav_usedCars1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"                <tr style='display:none'> "+
	"                  <td height='17' rowspan='2'>&nbsp;</td>"+
	"                  <td><a href=javascript:goto(18,'N')><img src='../images/left_nav_safety.gif' name='safety' width='150' height='19' border='0' id='safety' onMouseOver=MM_swapImage('safety','','../images/left_nav_safety1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"                <tr> </tr>"+
	"              </table></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td><a href='#' onMouseOver='MM_showHideLayers('press3','','hide','press2','','hide','press1','','hide','testDrive','','hide','Brochure','','hide')'><img src='../images/menu_beyond.gif' width='150' height='19' border='0'></a></td>"+
	"          </tr>"+
	"          <tr> "+
	"            <td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
	"                "+
	"                <tr> "+
	"                  <td width='10' height='14'><img src='images/spacer.gif' height='7' width='1'></td>"+
	"                  <td><a href=javascript:goto(16,'N') onMouseOver=MM_swapImage('gmlink','','images/left_nav_gmlink1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='images/left_nav_gmlink.gif' name='gmlink' width='150' height='19' border='0' id='gmlink'></a></td>"+
	"                </tr>"+
	"				<tr style='display:none'> "+
	"                  <td width='10'><img src='../images/spacer.gif' height='7' width='1'></td>"+
	"                  <td><a href=javascript:goto(17,'N') onMouseOver=MM_swapImage('fun','','../images/left_nav_entertainment1.gif',1) onMouseOut='MM_swapImgRestore()'><img src='../images/left_nav_entertainment.gif' name='fun' width='150' height='19' border='0' id='fun'></a></td>"+
	"                </tr>"+
	"					<tr> "+
	"                  <td height='18'>&nbsp;</td>"+
	"                  <td><a href=javascript:bookTestdriveCountry()><img src='../images/left_nav_bookTestdrive.gif' name='upload1' width='150' height='19' border='0' id='upload' onMouseOver=MM_swapImage('book','','images/left_nav_bookTestdrive1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"				<tr> "+
	"                  <td height='18'>&nbsp;</td>"+
	"                  <td><a href=javascript:reqBrochureCountry()><img src='../images/left_nav_reqBrochure.gif' name='upload1' width='150' height='19' border='0' id='upload' onMouseOver=MM_swapImage('request1','','images/left_nav_reqBrochure1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"                <tr> "+
	"                  <td height='18'>&nbsp;</td>"+
	"                  <td><a href=javascript:goto(20,'N')><img src='../images/left_nav_updated.gif' name='upload1' width='150' height='19' border='0' id='upload' onMouseOver=MM_swapImage('upload1','','../images/left_nav_updated1.gif',1) onMouseOut='MM_swapImgRestore()'></a></td>"+
	"                </tr>"+
	"              </table></td>"+
	"          </tr>"+
	"        </table>");

}
// code ends here
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
	

var country_list = new Array();
country_list[0] = new Array();
country_list[0][0] = "0";
country_list[0][1] = "Select a Country";
country_list[1] = new Array();
country_list[1][0] = "BH";
country_list[1][1] = "Bahrain";
country_list[2] = new Array();
country_list[2][0] = "JO";
country_list[2][1] = "Jordan";
country_list[3] = new Array();
country_list[3][0] = "KW";
country_list[3][1] = "Kuwait";
country_list[4] = new Array();
country_list[4][0] = "LB";
country_list[4][1] = "Lebanon";
country_list[5] = new Array();
country_list[5][0] = "OM";
country_list[5][1] = "Oman";
country_list[6] = new Array();
country_list[6][0] = "QA";
country_list[6][1] = "Qatar";
country_list[7] = new Array();
country_list[7][0] = "SA";
country_list[7][1] = "Saudi Arabia";
country_list[8] = new Array();
country_list[8][0] = "SY";
country_list[8][1] = "Syria";
country_list[9] = new Array();
country_list[9][0] = "AE";
country_list[9][1] = "United Arab Emirates";
country_list[10] = new Array();
country_list[10][0] = 'EG';
country_list[10][1] = "Egypt";
country_list[11] = new Array();
country_list[11][0] = "IQ";
country_list[11][1] = "Iraq";


var model_list = new Array();
model_list[0] = new Array();
model_list[0][0] = "0";
model_list[0][1] = "GM Corporate";
model_list[1] = new Array();
model_list[1][0] = "006";
model_list[1][1] = "Cadillac";
model_list[2] = new Array();
model_list[2][0] = "001";
model_list[2][1] = "Chevrolet";
model_list[3] = new Array();
model_list[3][0] = "012";
model_list[3][1] = "GMC";
model_list[4] = new Array();
model_list[4][0] = "019";
model_list[4][1] = "Opel";
model_list[5] = new Array();
model_list[5][0] = "015";
model_list[5][1] = "Saab";
model_list[6] = new Array();
model_list[6][0] = "018";
model_list[6][1] = "Hummer";
model_list[7] = new Array();
model_list[7][0] = "1000";
model_list[7][1] = "GM Fleet Solutions";
model_list[8] = new Array();
model_list[8][0] = "gmnext";
model_list[8][1] = "GMnext";



function callCountry(cntryCode)
{
	if (cntryCode == "0")
	{
		return;
	}
	else
	{
		location.href="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999^pageredirect&SellingSrc=72&cnInput=999/index.html^"+cntryCode;
	}
}

function showHide(X)
{
	X="vac"+X;
	if(document.getElementById(X).style.display == 'none')
	{
		document.getElementById(X).style.display = ''
	}
	else
	{
		document.getElementById(X).style.display = 'none'
	}
}

function callModel(modelCode)
{
	if (modelCode=='001')
	{
		//var abs_path="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/index.html^"+ctryCd;
		//location.href= abs_path;
		if(ctryCd != "EG")
		{
			//window.open("http://www.chevroletarabia.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/index.html^"+ctryCd,"","");
			window.open("http://" + ctryCd + "-en.chevroletarabia.com","","");
		}
		else
		{
		//	location.href="http://www.chevrolet.gmegypt.com"
			window.open("http://www.chevrolet.gmegypt.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/index.html^"+ctryCd,"","");
		}
	}
	if (modelCode=='006')
	{	
		if (ctryCd != "IQ")
		{
			//location.href='/GBPServiceMgr2.dyn?CntryCd='+ctryCd+'&LangCd=en&WebSiteID=GBP'+ctryCd+'&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999&SellingSrc=72&cnInput=006/index.html';
			window.open("http://www.cadillacarabia.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/index.html^"+ctryCd,"","");
		}
		else
		{
			alert("Cadillac is not available in Iraq.");
		}
	}
	if (modelCode=='012')
	{
	  if(ctryCd!="SY")
	  {
		if(ctryCd != "IQ")	  
		{
			//var abs_path="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/index.html^"+ctryCd;
			//location.href= abs_path;
			window.open("http://www.gmcarabia.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/index.html^"+ctryCd,"","");
		}
		else
		{
			alert("GMC is not available in Iraq.");
		}
	 }
	 else{
	 x=window.confirm(" GMC is not available in Syria. \n Press OK to go to the Country Selector page for GMCArabia.com. \n Press Cancel to stay on this page.");
	 if (x)
	{
		//location.href = "/content_data/LAAM/ME/en/GBPME/cs/012/index.html";
		window.open("http://www.gmcarabia.com","","");
	}
}
	} 
	if (modelCode=='015')
	{
		if(ctryCd != "IQ")
		{
			window.open("http://www.saabarabia.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=015^pageredirect&SellingSrc=72&cnInput=015/main/docs/saab/index.html^"+ctryCd,"","");
			//var abs_path="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=015^pageredirect&SellingSrc=72&cnInput=015/main/docs/saab/index.html^"+ctryCd;
			//location.href= abs_path;
		}
		else
		{
			alert("SAAB is not available in Iraq.");
		}
	}
	if (modelCode=='019')
	{
		if(ctryCd == "IQ")
		{
							alert("Opel is not available in Iraq.");
		}
		else
		{
			if(ctryCd != "EG")
			{
				//window.open("http://www.opelarabia.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/index.html^"+ctryCd,"","");
				window.open("http://www.opelarabia.com","","");

			}
			else
			{
				//location.href="http://www.opel.gmegypt.com";
				window.open("http://www.opel.gmegypt.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/index.html^"+ctryCd,"","");
			}		//location.href="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/index.html^"+ctryCd;
		}
	}
	if (modelCode=='999')
	{
		if(ctryCd != "EG")
		{
			window.open("http://www.gmarabia.com","","");
		}
		else
		{
			window.open("http://www.gmegypt.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999^pageredirect&SellingSrc=72&cnInput=999/index.html^"+ctryCd,"","");
		}	//location.href="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999^pageredirect&SellingSrc=72&cnInput=999/index.html^"+ctryCd;
	}
	if (modelCode=='1000')
	{
		call_fleet();
	}
	if (modelCode=='1001')
	{
		call_page('999/advantage.html');
	}
	if (modelCode=='018')
	{
		if(ctryCd != "IQ")
		{
				window.open("http://www.hummerarabia.com/content_data/LAAM/ME/en/GBPME/018/flash/home.html","","");
		}
		else
		{
			alert("Hummer is not available in Iraq.");
		}
	}
	
	if(modelCode == "gmnext"){
		window.open("http://www.gmnext.com/","","");
	}
}


function populateCountry()
{
	document.write("<select name=s1 class='dropdown' onChange='callCountry(this.value)'>");
	for (var i= 1; i< country_list.length; i++)
	{
		document.write("<option value="+country_list[i][0]+">"+country_list[i][1]+"</option>");
	}
	document.write("</select>");
	document.write('<scr'+'ipt>for (i=0;i<document.all["s1"].options.length;i++){ if (document.all["s1"].options[i].value=="'+ctryCd+'") document.all["s1"].options[i].selected = true}</scr'+'ipt>');
}

/*function populateBrand()
{
	document.write("<select name=s2 class='dropdown1' onChange='callModel(this.value)'>");
	for (var i= 0; i< model_list.length; i++)
	{
			//If the country is Syria we need to Skip GMC from the Brandlist
			if(location.href.indexOf("/SY/")>0)
			{	if (i!=3)
					document.write("<option value="+model_list[i][0]+">"+model_list[i][1]+"</option>");
			}
			else
				document.write("<option value="+model_list[i][0]+">"+model_list[i][1]+"</option>");
	}
	document.write("</select>");
	document.write('<scr'+'ipt>document.all["s2"].options[0].selected = true</scr'+'ipt>');
}*/
/* New code added for Brand Population for Egypt and Iraq by Siva on 22-Mar-2006 */
function populateBrand()
{
	if (ctryCd != 'EG' && ctryCd != 'IQ')
	{
	document.write("<select name=s2 class='dropdown1' onChange='callModel(this.value)'>");
		for (var i= 0; i< model_list.length; i++)
	{
			//If the country is Syria we need to Skip GMC from the Brandlist
			if(location.href.indexOf("/SY/")>0)
			{	if (i!=3)
					document.write("<option value="+model_list[i][0]+">"+model_list[i][1]+"</option>");
			}
			else
				document.write("<option value="+model_list[i][0]+">"+model_list[i][1]+"</option>");
	}
	document.write("</select>");
	document.write('<scr'+'ipt>document.all["s2"].options[0].selected = true</scr'+'ipt>');
	}
	else
	{
		if (ctryCd != 'IQ')
		{
		document.write("<select name=s2 class='dropdown1' onChange='callModel(this.value)'>");
		document.write("<option value="+model_list[0][0]+">"+model_list[0][1]+"</option>");
		document.write("<option value="+model_list[2][0]+">"+model_list[2][1]+"</option>");
		document.write("<option value="+model_list[4][0]+">"+model_list[4][1]+"</option>");
		document.write("<option value="+model_list[7][0]+">"+model_list[7][1]+"</option>");
		document.write("</select>");
		document.write('<scr'+'ipt>document.all["s2"].options[0].selected = true</scr'+'ipt>');
		}
		else
		{
		document.write("<select name=s2 class='dropdown1' onChange='callModel(this.value)'>");
		document.write("<option value="+model_list[0][0]+">"+model_list[0][1]+"</option>");
		document.write("<option value="+model_list[2][0]+">"+model_list[2][1]+"</option>");
		document.write("<option value="+model_list[7][0]+">"+model_list[7][1]+"</option>");
		document.write("</select>");
		document.write('<scr'+'ipt>document.all["s2"].options[0].selected = true</scr'+'ipt>');
		}
	}
}

function lumina()
{
	alert("This will take you to Lumina Site")
}

function call_fleet()
{
	if(ctryCd != "EG")
	{///content_data/LAAM/ME/en/GBPME/GMFleet/main/fleet_index.htm
	window.open("/GBPServiceMgr2.dyn?CntryCd=BV&LangCd=en&WebSiteID=GBPBV&ReqsType=Pull&ServiceName=EntryForm&cfInput=test","Fleet","height=450,width=650,left=150,top=120,status=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
	return;
	}
	else
	{
		call_page('999/gm_fleet.html');
	}
	
}
//Opens the Chevroletlive.com Lumina Page.
function lumina_banner()
{
	
	window.open("http://www.chevroletlive.com/ChevroletMyLife/lumina/home_eng.aspx","","");
}
//HummerArabia
function call_hummer()
{
	if(ctryCd != "IQ")
	{
		//location.href="/content_data/LAAM/ME/en/GBPME/018/index.html"
		window.open("http://www.hummerarabia.com/content_data/LAAM/ME/en/GBPME/018/index.html","","");
	}
	else
	{
		alert("Hummer is not available in Iraq.");
	}
}
var path="/content_data/LAAM/ME/en/GBPME/999/images";

function TopNav()
{
document.write("<table width='780' border='0' cellspacing='0' cellpadding='0'><tr><td><table width='780' border='0' cellpadding='0' cellspacing='0'><tr><td width='5%' valign='top'><a href=javascript:goto(0,'N');><img src='"+path+"/gmlogo.gif' width='44' height='43' border='0'></a></td><td valign='top'><img src='"+path+"/spacer.gif' width='2' height='1'></td>    <td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='200' height='20' align='Left' bgcolor='#003063'><a href=javascript:goto(1,'N');><img src='"+path+"/gcc_corp_site.gif' width='75' height='13' border='0'></a>&nbsp;</td><td align='right' bgcolor='#003063'><table width='474' border='0' cellspacing='0' cellpadding='1'><tr><td width='371' align='right'><img src='"+path+"/gcc_corp_home_owner.gif' width='139' height='15' border='0' usemap='#Map2MapMap'><img src='"+path+"/arabic_text.jpg' width='36' height='15' border='0' usemap='#Map3MapMap'></td><td width='103' align='right'><scr"+ "ipt>populateCountry();</scr"+"ipt></td></tr></table></td></tr><tr><td height='23' align='left' bgcolor='#9CCFFF'>&nbsp;<scr"+ "ipt>populateBrand();</scr"+"ipt><img src='"+path+"/spacer.gif' height='6' width='1'> </td><td align='right' bgcolor='#9CCFFF'><img src='"+path+"/top_link.gif' width='495' height='17' border='0' usemap='#MapMapMap'></td></tr></table></td></tr></table><map name='Map2MapMap'><area shape='rect' coords='45,2,130,14' href=javascript:goto(7,'N'); target='_top'></map><map name='MapMapMap'><area shape='rect' coords='49,2,124,14' href=javascript:goto(2,'N');><area shape='rect' coords='135,2,178,15' href=javascript:goto(4,'N');><area shape='rect' coords='188,2,244,14' href=javascript:goto(5,'N');><area shape='rect' coords='307,1,395,14' href=javascript:goto(6,'N');><area shape='rect' coords='249,3,300,14' href=javascript:goto(22,'N');><area shape='rect' coords='399,2,493,15' href=javascript:goto(23,'N');></map><map name='Map2MapMap'><area shape='rect' coords='5,1,31,23' href=javascript:goto(7,'N');><area shape='rect' coords='45,2,130,14' href=javascript:goto(8,'N');></map> <map name='Map3MapMap'><area shape='rect' coords='3,1,35,12' href=javascript:goto(19,'N');></map></td></tr></table>")
}
//for SAAB and GMC especially the site lanaded in Syria
function callSaab()
{
	x=window.confirm("Saab is not available in Syria. \n Press OK to go to the Country Selector page for SaabArabia.com. \n Press Cancel to stay on this page.");
	if (x)
	{
		//location.href = "/content_data/LAAM/ME/en/GBPME/cs/015/index.html";
		window.open("http://www.saabarabia.com","","");
	}
}
function callGMC()
{

	x=window.confirm("GMC is not available in Syria. \n Press OK to go to the Country Selector page for GMCArabia.com. \n Press Cancel to stay on this page.");
	if (x)
	{
		//location.href = "/content_data/LAAM/ME/en/GBPME/cs/012/index.html";
		window.open("http://www.gmcarabia.com","","");
	}
}


//corp_links.js follows
function dealerLocatorCountry()
{
//	location.href="/content_data/LAAM/SA/en/GBPSA/corp/locator_01.htm"
//	location.href="/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=DealerLocator&NampltCd=999&SellngSrc=72";
if (ctryCd != "EG")
{
	location.href="/content_data/LAAM/ME/en/GBPME/999/G1/dllocator.html?namplt_cd=999&cntryCd="+ctryCd+"&lang_cd=en^"+ctryCd;
}
else
{
location.href="/content_data/LAAM/ME/en/GBPME/999/EG/dllocator.html?namplt_cd=999&cntryCd="+ctryCd+"&lang_cd=en^"+ctryCd;
}
}

function showroomCountry()
{
//	location.href="/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/corp/showroom/showroom.htm"
	call_page('999/showroom_new.html');
}

/*function advisorCountry()
{
	//location.href="/content_data/LAAM/SA/en/GBPSA/corp/advisor_01.htm"
	location.href="/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=VehicleSelectionGuide";

}*/



function reqBrochureCountry()
{
	//alert("RB"+ ctryCd)
if(ctryCd == 'IQ')
{
	alert(formAlert);
}
else{
var x_url ="";
			try
			{
				//x_url = "/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999&SellingSrc=72&MerchModlDesgtr="+mmd+"&ModelCode="+mmd.substring(0,2)+"&cnInput=cnInput";
				x_url="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^RB^N^"+ctryCd+"^&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
		
			}
			catch(e)
			{
				//x_url="/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999&SellingSrc=72&cnInput=cnInput";
				x_url="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^RB^N^"+ctryCd+"^&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
		
			}
			//location.href=x_url;
			window.open(x_url,"Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=disabled");
}		
}
function bookTestdriveCountry()
{
//	location.href="/content_data/LAAM/SA/en/GBPSA/corp/locator_04.htm"

	if(ctryCd != 'EG' && ctryCd != 'IQ')
	{	
		var URLVar ="";
		try
		{
		//	URLVar="/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999&SellingSrc=72&MerchModlDesgtr="+mmd+"&ModelCode="+ mmd.substring(0,2);
		URLVar="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^TD^N^"+ctryCd+"^&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
	
		}
		catch(e)
		{
		URLVar="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^TD^N^"+ctryCd+"^&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
		}
		//location.href=URLVar;
		window.open(URLVar,"Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=disabled");
		
	}
	else {
	if(ctryCd =='EG')
	{alert(" Test drive faclilty is not available in Egypt");}
	else{if(ctryCd == 'IQ')alert(formAlert);}
	}
}
//Request for Brochure Link from New DealerLocator 
function callRequestBrochureDL(namepltcd,ctryCd,dlrname)
{
	if(ctryCd == 'IQ')
	{
		alert(formAlert);
	}
	else{
	dealerName_from_DL = dlrname;
	dlrname="DLR";
	var x_url ="";
	try
	{
		//x_url = "/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999&SellingSrc=72&MerchModlDesgtr="+mmd+"&ModelCode="+mmd.substring(0,2)+"&cnInput=cnInput";
		x_url="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^RB^N^"+ctryCd+"^"+dlrname+"&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
	}
	catch(e)
	{
		//x_url="/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999&SellingSrc=72&cnInput=cnInput";
		x_url="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^RB^N^"+ctryCd+"^"+dlrname+"&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
	}
	//location.href=x_url;
	window.open(x_url,"Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=disabled");
}
}
//Test Drive from New DealerLocator 
function callTestDriveDL(namepltcd,ctryCd,dlrname)
{
if(ctryCd != 'EG' && ctryCd != 'IQ')
{
	dealerName_from_DL = dlrname;
	dlrname="DLR";
	var URLVar ="";
		try
		{
		//	URLVar="/GBPServiceMgr2.dyn?CntryCd="+ctryCd+"&LangCd=en&WebSiteID=GBP"+ctryCd+"&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999&SellingSrc=72&MerchModlDesgtr="+mmd+"&ModelCode="+ mmd.substring(0,2);
		URLVar="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^TD^N^"+ctryCd+"^"+dlrname+"&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
	
		}
		catch(e)
		{
		URLVar="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^TD^N^"+ctryCd+"^"+dlrname+"&SellingSrc=72&MerchModlDesgtr=1BBSE&ModelCode=1B";
		}
		//location.href=URLVar;
		window.open(URLVar,"Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=disabled");
}
else{
	if(ctryCd =='EG')
	{alert(" Test drive faclilty is not available in Egypt");}
	else{if(ctryCd == 'IQ')alert(formAlert);}
}
}
corp_header_links = new Array();

//corp_header_links[0]="http://www.gm.com";
corp_header_links[0]="javascript:call_page('999/index.html');";
corp_header_links[1]="javascript:call_page('999/index.html');";
corp_header_links[2]="javascript:dealerLocatorCountry();";//"/content_data/LAAM/ME/en/GBPME/999/G1/dllocator.html?namplt_cd=999&cntryCd="+ctryCd+"&lang_cd=en";
corp_header_links[3]="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=Search&NampltCd=999";
corp_header_links[4]="javascript:call_page('999/sitemap.html');";
corp_header_links[5]="#";//Contact Us
corp_header_links[6]="javascript:call_page('999/gm_privacy.html');";
corp_header_links[7]="javascript:call_page('999/index.html');";
corp_header_links[8]="#";/// GM Link
corp_header_links[9]="javascript:call_page('999/gm_vision_mission.html');";//vision & mission
corp_header_links[10]="javascript:call_page('999/gm_history.html');";//gm history
corp_header_links[11]="javascript:call_page('999/gm_news.html');";//gm news
corp_header_links[12]="javascript:call_page('999/gmdifference.html');";//gm difference
corp_header_links[13]="javascript:call_fleet();";//gm fleet
//corp_header_links[14]="javascript:call_page('999/advantage.html');";//advantage
corp_header_links[15]="javascript:call_page('999/gm_promotions.html');";//promotions
corp_header_links[16]="#";//gm link
corp_header_links[17]="javascript:call_page('999/fun_ent1.html');";//fun n ent
corp_header_links[18]="javascript:call_page('999/games.html');";//Safety
corp_header_links[19]="#";
corp_header_links[20]="#";
corp_header_links[22]="javascript:call_page('999/gm_copyright.html');";
corp_header_links[23]="javascript:call_page('999/gm_copyright.html');";

function gmLink()
{
	if(ctryCd=='IQ')
		{
		alert(formAlert);
		return;
		}	
		else{
		window.open("/GBPServiceMgr2.dyn?CntryCd=BV&LangCd=en&WebSiteID=GBPBV&ReqsType=Pull&ServiceName=EntryForm&regInput=test","Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=yes");
		return;}
}

function goto(index,pop)
{
	var i = index;
	var flag= pop;
	if (i==5)
	{
			if(ctryCd == 'IQ')
			{
				alert("For enquiries, call our Customer Communication Center +97143143465");
			}
				else
				{
				var URLVar="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=ContactSector&NampltCd=999^"+ctryCd;//"/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=VehicleComparator&cnInput=test&NampltCd=015";
				window.open(URLVar,"Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=disabled");
				}
	}
	
	if (i==8)
	{	if(ctryCd == 'IQ')
			{
					alert(formAlert);
			}
				else{
					window.open("/GBPServiceMgr2.dyn?CntryCd=BV&LangCd=en&WebSiteID=GBPBV&ReqsType=Pull&ServiceName=EntryForm&regInput=test","Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=yes");
					return;
				}
	}
	
	if (i==16)
	{	if(ctryCd == 'IQ')
			{
					alert(formAlert);
			}
				else{
					window.open("/GBPServiceMgr2.dyn?CntryCd=BV&LangCd=en&WebSiteID=GBPBV&ReqsType=Pull&ServiceName=EntryForm&regInput=test","Fleet","width=700,height=600,left=150,top=80,scrollbars=yes,resizable=yes");
					return;
				}
	}
	
	
	
	if (i==13)
	{
		if (ctryCd != "EG" )
		{
		//window.open("/content_data/LAAM/ME/en/GBPME/GMFleet/main/fleet_index.htm","Fleet","width=650,height=500,left=150,top=120,scrollbars=yes,resizable=yes");
		window.open("/GBPServiceMgr2.dyn?CntryCd=BV&LangCd=en&WebSiteID=GBPBV&ReqsType=Pull&ServiceName=EntryForm&cfInput=test","Fleet","width=650,height=500,left=150,top=120,scrollbars=yes,resizable=yes");
		return;
		}
		else{
		call_page('999/gm_fleet.html');
		}
	}
	
	if(i==19)
	{
		var page_url = location.href;
		/*if(page_url.indexOf("/en") > -1 && (page_url.indexOf("Brand") > -1 || page_url.indexOf("accessories") > -1 || page_url.indexOf("accessory") > -1 || page_url.indexOf("Accessory") > -1)) {
			var flg=confirm("Accessories are available only in English. Please click OK to go to English site or Cancel to stay here.");
			var myUrl = document.location+""; 
			var spl=myUrl.split("?");
			var str=spl[1];
			if(flg ) {
				s = new String(myUrl);
				s.replace("/ar","/en");
				location.href=s;
			}
		}
		else {*/
			if (page_url.indexOf("action") > 0)
			{
				var isSelected = window.confirm("The selected action will reset the information for your session. To continue this action, click OK. To cancel, click CANCEL");
				if(isSelected)
					//location.href = "/content_data/LAAM/"+ctryCd+"/ar/GBP"+ctryCd+"/corp/index.htm";
				var BaseURL="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=ar&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999^pageredirect&SellingSrc=72&cnInput=999/index.html^"+ctryCd;
			 location.href=BaseURL;
				return;
			}
			else
			{
				var langPosition = page_url.indexOf("/en");
				if(page_url.indexOf("/en") > -1 && (page_url.indexOf("Brand") > -1 || page_url.indexOf("accessories") > -1 || page_url.indexOf("accessory") > -1 || page_url.indexOf("Accessory") > -1)) {
				//	var flg=confirm("Accessories are available only in English. Please click OK to go to English site or Cancel to stay here.");

var flg=confirm("Accessories are available in English only. Click OK to go to GM Arabic Homepage, or Cancel to stay here.");
					
					if(flg) {
//						location.href = page_url.substring(0,langPosition) +"/ar"+page_url.substring(langPosition+3,page_url.length);
						goArabic()
						return;
					}
				}
				else {
					location.href = page_url.substring(0,langPosition) +"/ar"+page_url.substring(langPosition+3,page_url.length);
					return;
				}

			}
		//}
	}
	if(i==20)
	{
		//alert("This will take you to Opt in Form")
		if(ctryCd == 'IQ')
	{
	alert(formAlert);
	}
	else{
		window.open("/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=EntryForm&newPage="+ctryCd+"&NampltCd=999","Fleet","width=650,height=500,left=150,top=80,scrollbars=yes,resizable=yes");
		return;
	}}
	
	//	alert (i + " " + flag + " " + corp_header_links[i]);
	location.href=corp_header_links[i];
}

var model_id = new Array();
model_pages = new Array();

model_id[0] = "OA";
model_pages[0] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OA/OA_home.html^"+ctryCd;

model_id[1] = "OB";
model_pages[1] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OB/OB_home.html^"+ctryCd;

model_id[2] = "OC";
model_pages[2] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OC/OC_home.html^"+ctryCd;

model_id[3] = "OM";
model_pages[3] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OM/OM_home.html^"+ctryCd;

model_id[4] = "OV";
model_pages[4] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OV/OV_home.html^"+ctryCd;

model_id[5] = "OO";
model_pages[5] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/index.html^"+ctryCd;

model_id[6] = "OZ";
model_pages[6] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OZ/OZ_home.html^"+ctryCd;

model_id[7] = "6C";
//model_pages[7] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6C/cts_pho_exteriorphotos.html^"+ctryCd;
model_pages[7] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/CTS/gallery_exterior.html";

model_id[8] = "6D";
//model_pages[8] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6D/dts_pho_exteriorphotos.html^"+ctryCd
// "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME"&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006&SellingSrc=72&cnInput=006/6D/dts_pho_exteriorphotos.html";
model_pages[8] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/DTS/gallery_exterior.html";

model_id[9] = "6E";
//model_pages[9] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6E/escalade_pho_exteriorphotos.html^"+ctryCd
//model_pages[9] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/G1/escalage_en.html^"+ctryCd
model_pages[9] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/Escalade/gallery_exterior.html";

model_id[10] = "6S";
//model_pages[10] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6S/sts_pho_exteriorphotos.html^"+ctryCd
model_pages[10] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/STS/gallery_exterior.html";

model_id[11] = "4E";
//model_pages[11] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/envoy/envoy_index.htm";
model_pages[11] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4E/4E_home.html^"+ctryCd

model_id[12] = "4S";
//model_pages[12] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/safari/safari_index.htm";
model_pages[12] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4S/4S_home.html^"+ctryCd

model_id[13] = "4U";
//model_pages[13] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/suburban/suburban_index.htm";
model_pages[13] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4U/4U_home.html^"+ctryCd

model_id[14] = "4Y";
//model_pages[14] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/yukon/yukon_index.htm";
model_pages[14] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4Y/4Y_home.html^"+ctryCd

model_id[15] = "SC";
model_pages[15] = "93_CONV/index.html";

model_id[16] = "SS";
model_pages[16] = "93_S/index.html";

model_id[17] = "SE";
model_pages[17] = "95/index.html";

model_id[18] = "SG";
model_pages[18] = "93_WAGON/index.html";

//Trailblazer
model_id[19] = "1Z";
model_pages[19] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1Z/1ZL4D_overview.html^"+ctryCd

//Chevrolet Spark
model_id[20] = "1K";
//model_pages[20] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1K/1K_home.html^"+ctryCd
model_pages[20] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/spark/index.html";

//Caprice
model_id[21] = "1C";
//model_pages[21] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1C/1C_home.html^"+ctryCd
model_pages[21] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/caprice/index.html";


model_id[22] = "1L";
//model_pages[22] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1L/1L_home.html^"+ctryCd
model_pages[22] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/lumina/index.html";

//Optra
model_id[23] = "1P";
//model_pages[23] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1P/1PT5D_overview.html^"+ctryCd
model_pages[23] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/optra/index.html"

//May be Colorado
model_id[24] = "2R";
//model_pages[24] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1R/1R_home.html^"+ctryCd
model_pages[24] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/trucks_vans/colorado/index.html";

//Tahoe
model_id[25] = "1T";
model_pages[25] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1T/1T_home.html^"+ctryCd
model_pages[25] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/crossovers_suvs/tahoe/index.html";

//Suburban
model_id[26] = "1U";
//model_pages[26] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1U/1U_home.html^"+ctryCd
model_pages[26] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/crossovers_suvs/suburban/index.html";

model_id[27] = "1W";
model_pages[27] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1W/1W_home.html^"+ctryCd

//Corvette
model_id[28] = "1Y";
//model_pages[28] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1Y/1Y_home.html^"+ctryCd
model_pages[28] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/corvette_family/index.html";

//Express
model_id[29] = "1X";
//model_pages[29] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1X/1X_home.html^"+ctryCd
model_pages[29] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/trucks_vans/express/index.html";

model_id[30] = "1O";
//model_pages[30] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1O/1OL4D_overview.html^"+ctryCd
model_pages[30] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/aveo/index.html";

//Epica
model_id[31] = "1E";
//model_pages[31] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1E/1E_home.html^"+ctryCd
model_pages[31] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/epica/index.html";

model_id[32] = "6X";
//model_pages[32] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6X/ext_pho_exteriorphotos.html^"+ctryCd
model_pages[32] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/EXT/gallery_exterior.html";

model_id[33] = "6V";
//model_pages[33] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6V/esv_pho_exteriorphotos.html^"+ctryCd
model_pages[33] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/ESV/gallery_exterior.html";

model_id[34] = "OS";
model_pages[34] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OS/OS_home.html^"+ctryCd;

//Avalanche
model_id[35] = "1A";
//model_pages[35] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1A/1A_home.html^"+ctryCd
model_pages[35] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/trucks_vans/avalanche/index.html";

model_id[36] = "4X";
//model_pages[36] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/envoy_xl/envoy_index.htm";
model_pages[36] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4X/4X_home.html^"+ctryCd

model_id[37] = "1G";
model_pages[37] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1G/1G_home.html^"+ctryCd

model_id[38] = "6L";
//model_pages[38] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/6L/xlr_pho_exteriorphotos.html^"+ctryCd
model_pages[38] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/XLR/gallery_exterior.html"

model_id[39] = "6R";
model_pages[39] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/SRX/gallery_exterior.html";

model_id[40] = "8S";
model_pages[40] = "/content_data/LAAM/ME/en/GBPME/018/flash/home.html";

model_id[41] = "8H";
model_pages[41] = "/content_data/LAAM/ME/en/GBPME/018/flash/home.html";

model_id[42] = "8J";
model_pages[42] = "/content_data/LAAM/ME/en/GBPME/018/flash/home.html";

//Seems Colorado
//but going from optra link,
model_id[43] = "1R";
//model_pages[43] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1P/1PLSE_overview.html^"+ctryCd
//model_pages[43] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/trucks_vans/colorado/index.html"
model_pages[43] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/optra/index.html";

model_id[44] = "1N";
model_pages[44] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1N/1N_home.html^"+ctryCd

model_id[45] = "1B";
model_pages[45] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1B/1B_home.html^"+ctryCd

model_id[46] = "OR";
model_pages[46] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=019^pageredirect&SellingSrc=72&cnInput=019/OR/OR_home.html^"+ctryCd;

model_id[47] = "4A";
model_pages[47] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4A/4A_dimensions.html^"+ctryCd

model_id[48] = "4B";
model_pages[48] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4B/4B_dimensions.html^"+ctryCd

//Silverado
model_id[49] = "1D";
//model_pages[49] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1D/1D_home.html^"+ctryCd
model_pages[49] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/trucks_vans/silverado/index.html";

model_id[50] = "4L";
//model_pages[13] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/suburban/suburban_index.htm";
model_pages[50] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4D/4D_home.html^"+ctryCd

model_id[51] = "4D";
//model_pages[14] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/yukon/yukon_index.htm";
model_pages[51] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4D/4D_home.html^"+ctryCd

model_id[52] = "6B";
//model_pages[14] = "/content_data/LAAM/"+ctryCd+"/en/GBP"+ctryCd+"/GMC/models/yukon/yukon_index.htm";
//model_pages[54] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=006^pageredirect&SellingSrc=72&cnInput=006/G1/sedan.html^"+ctryCd
model_pages[52] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/BLS/gallery_exterior.html";

//Captiva
model_id[53] = "1H";
//model_pages[53] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1H/1H_home.html^"+ctryCd
model_pages[53] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/crossovers_suvs/captiva/index.html"

model_id[54] = "SX";
model_pages[54] = "97_X/index.html";

model_id[55] = "4C";
model_pages[55] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4C/4C_home.html^"+ctryCd

//Camaro
model_id[56] = "1I";
//model_pages[56] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1I/1I_home.html^"+ctryCd
model_pages[56] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/camaro/index.html";

model_id[57] = "1J";
model_pages[57] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1J/1J_home.html^"+ctryCd

//Chevrolet Cruze
model_id[58] = "1F";
//model_pages[58] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1F/1F_home.html^"+ctryCd
model_pages[58] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/cruze/index.html";

model_id[59] = "4T";
model_pages[59] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=012^pageredirect&SellingSrc=72&cnInput=012/4T/4T_home.html^"+ctryCd;

model_id[60] = "6CV";
model_pages[60] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/CTS/gallery_exterior.html";

model_id[61] = "8T";
model_pages[61] = "http://www.hummer.com/hummerjsp/home.jsp";

model_id[62] = "1V";
//model_pages[62] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=ar&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1O/1O_home.html^"+ctryCd
model_pages[62] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/aveo5/index.html";

model_id[63] = "6P";
model_pages[63] = "http://www.cadillacarabia.com/content_data/LAAM/ME/en/GBPME/cadillac/Escalade/platinum.html";

//Traverse
model_id[64] = "1S";
//model_pages[64] = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=ar&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1S/1S_home.html^"+ctryCd
model_pages[64] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/crossovers_suvs/traverse/index.html";

//Malibu
model_id[65] = "1M";
//model_pages[64] ="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1M/1M_home.html^"+ctryCd;
model_pages[65] = "http://" + ctryCd + "-en.chevroletarabia.com/vehicles/view_all_vehicles/cars/malibu/index.html";


function call_model(modelCode)
{
var gccURLpage="/content_data/LAAM/ME/en/GBPME/015/G2/main/GLOBAL/en/model/";
var levURLpage="/content_data/LAAM/ME/en/GBPME/015/main/GLOBAL/en/model/";

for (i=0;i<model_id.length ;i++ )
{
	if (modelCode==model_id[i])
	{
		//location.href=model_pages[i];
		//added by Kiran Anthony for SAAB redirection
		if(modelCode=='SS' || modelCode=='SG' || modelCode=='SX' || modelCode=='SC' || modelCode=='SE')
		{
			if(ctryCd=='JO' || ctryCd=='LB' || ctryCd=='SY')
				{
					
					var targetL=gccURLpage+model_pages[i];
					window.open(targetL,'targetwindow','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,left=0,top=0')
		//width='+screen.width+',height='+(screen.height-200)
		break;
				}
			else if(ctryCd=='AE' || ctryCd=='BH' || ctryCd=='OM' || ctryCd=='QA' || ctryCd=='KW' || ctryCd=='SA' || ctryCd=='IQ')
				{
					
					var targetG=levURLpage+model_pages[i];
					window.open(targetG,'targetwindow','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,left=0,top=0')
		//width='+screen.width+',height='+(screen.height-200)
		break;
				}
			else{ }
	    }
		else {
			window.open(model_pages[i],'targetwindow','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,left=0,top=0')
		//width='+screen.width+',height='+(screen.height-200)
		break;
			
		}
		
	/*
	if (modelCode=="6B" || modelCode=="6E")
		{
			//location.href=model_pages[i];
			window.open(model_pages[i],'targetwindow','height=575,width=620,left=150,top=120,status=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=no')
			//width='+screen.width+',height='+(screen.height-200)
			break;
		}
	
	else {*/
		
	//}
	}
}

}
function fleet_contact()
{
alert('Add your code  here')
}
function call_page(targURL)
{
   	var cntryCode=ctryCd;
          var BaseURL="/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=999^pageredirect&SellingSrc=72&cnInput=";
          newURLValue=targURL;
          var targetURL="";
          var windowName="";
          var windowParams="";
          switch(call_page.arguments.length)
          {
                   case 0:
                             alert("No Parameters found\n Improper Usage of Function\n\n Usage 1: call_page('001/<target HTML file>');\n Usage 2: call_page('999/<target HTML file>','Y');\n Usage 3: call_page('001/<target HTML file>','<window name>','<window parameters>');");
                             break;
                   case 1:
                             targetURL=targURL; //Target URL
newURLValue=targetURL; //Target path assigned to this Global variable. Used in Popup opened.
                             if(targetURL.indexOf("http://")==0)
                                      location.href=targetURL;
                             else
                                      location.href=BaseURL+targetURL+"^"+cntryCode; //Open URL in same window using RFB include action
                             break;
                   case 2:
                             targetURL=call_page.arguments[0]; //Target URL
                             windowParams=call_page.arguments[1]; //Target Window Parameters
                             if(windowParams.toUpperCase()=="Y")
                             {
                                      window.open(targetURL); //Open in a blank window
                             }
                             if(windowParams.toUpperCase()=="OPENER")
                             {
                                      window.opener.location.href=BaseURL+targetURL+"^"+cntryCode;
									  self.window.close();
									   //Open in a parent window
                             }
                             break;
                   case 3:
                             targetURL=call_page.arguments[0]; //Target URL
                             windowName=call_page.arguments[1]; //Target Window Name
                             windowParams=call_page.arguments[2]; //Target Window Parameters
                             if(targetURL.indexOf("http://")==0)
                             {
				window.open(targetURL,windowName,windowParams); //Website to be Open in a new window (name mentioned in windowName).
                             }
                             else
                             {

				newURLValue=targetURL; //Target path assigned to this Global variable. Used in Popup opened.
				/*if(targetURL == "001/imagegallary.html")
				{
					var positionID = "top=xx,left=xx";
				}*/
				window.open(BaseURL+targetURL+"^"+cntryCode,windowName,windowParams); //Open in a new window (name mentioned in windowName).

                             }
                             break;
          }
}
//All Pop-up is closed by Mathan by 30th July 2004 7.35PM
// Cookie Section Starts here...  //
/*
var expDays = 1; // number of days the cookie should last


function GetCookie (name) 
{  
	var arg = name + "=";  
	var alen = arg.length;
	var clen = document.cookie.length;

	var i = 0;  
	while (i < clen) 
	{    
		var j = i + alen; 

		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;  
		//alert(i);
		if (i == 0) break;   
	}  
	return null;
}


function SetCookie (name, value) 
{  
	//alert("Name :" +name +  "   Value:"+value);
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
//	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
//	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
}


function DeleteCookie (name) 
{
	var exp = new Date("January 1, 1970");
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*1*1*60*1000));

function amt()
{
	var count = GetCookie('count')
	if(count == null) 
	{
	SetCookie('count','1')
	return 1
	}
	else 
	{
		var newcount = parseInt(count) + 1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
   }
}

function getCookieVal(offset) 
{
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
		endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
}


function checkCount(popCookie,win_name,winoption,loadevent)
{
		
			var count = GetCookie(popCookie);
			//alert("Count:"+count+ "  name:" + popCookie);
			if (count == null) 
			{
				count=1;
				SetCookie(popCookie, count, exp);
				
				OpenWindow(win_name,winoption);
				//win=window.open(page, "", windowprops);
				//win.blur();
			}
			else 
			{
				count++;
				//SetCookie('count', count, exp);
			}
}

var kill_date = new Date();
// Cookie Section ends here...  //


//Class Function 
function page_Class(pageURL,SurveyName,winOptions,Loadevent,targetCountry)
{
  this.pageURL = pageURL;
  this.SurveyName = SurveyName;
  this.WinOptions = winOptions;
  this.Loadevent = Loadevent;
  this.targetCountry=targetCountry
 }


//Array list contains the URL , Survey / Form , Form opening options , Load Event
var page_List=new Array();
page_List[0]=new page_Class("corp","Survey2","popback","page_enter","AE^BH^JO^KW^LB^OM^QA^SA^SY"); 
//page_List[1]=new page_Class("advantage","Survey1","popup","page_enter","SA");

var win_name;
var Survey_flag=false;
for(i=0;i<page_List.length;i++)
{
	var temp_Ctry_List=new Array();
	temp_Ctry_List=page_List[i].targetCountry.split("^");
	for(j=0;j<temp_Ctry_List.length;j++)
	{
		if(temp_Ctry_List[j]==ctryCd)
		{
			//alert(temp_Ctry_List[j] + "Countrycode:"+ctryCd)
			if(location.href.indexOf(page_List[i].pageURL)>0)
				{
						
						
						if(page_List[i].SurveyName=="Survey1")
							{
								Survey_flag=true;	
								//alert(page_List[i].SurveyName);
							}
							else if(page_List[i].SurveyName=="Survey2")
							{	
								Survey_flag=true;
								//alert(page_List[i].SurveyName);
							}
							
							//Cookie Start
							if(Survey_flag) //If Survey ==true
							{
									var setcookiename=page_List[i].SurveyName;
									//var setcookiename= page_List[i].WinOptions+"_"+page_List[i].SurveyName+"_"+ctryCd+"_en"+"_"+"Corp";
									win_name=page_List[i].SurveyName;
									var win_option1=page_List[i].WinOptions;
									var load_event=page_List[i].Loadevent;
									
									//alert("Page :"+page_List[i].Loadevent);
								if (page_List[i].Loadevent=="page_exit")
									{
										document.write("<body onunload='javascript:onExit(setcookiename,win_name,win_option1,load_event);'>");
										//alert("Page Inside :"+page_List[i].Loadevent);
									}
								else
									{
										var param = self.location.search;
										if(param!="")
										{
											SetCookie("Survey2", 1, exp);
										}
										else
										{
											checkCount(setcookiename,win_name,page_List[i].WinOptions,page_List[i].Loadevent);
										}
									}
							}
							//Cookie End
				}
		}
	}

	
}

function OpenWindow(WinName,winoption)
{	
	if(WinName=="Survey1")
	{
	var windowprops = "width=290,height=350,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
	var win=window.open("/content_data/LAAM/BV/en/GBPBV/"+WinName+"_ar.htm",WinName,windowprops);
	if (winoption=="popback")
	{
		win.blur()
	}
	}

	if(WinName=="Survey2")
	{

	var x=screen.width;
	var y=screen.height;
	positn="left="+Math.floor((x-641)/2)+",top="+Math.floor((y-583)/2);
	var windowprops="resizable=yes,width=641,height=583,"+positn+",scrollbars=yes";
	var win=window.open("http://web.refleks.com/index.php?surveyid=11667&newlang=en&refc=Corporate",WinName,windowprops);
	if (winoption=="popback")
	{
		win.blur()
	}
	
	}


}

function onExit(popCookie,win_name,winoption,loadevent)
{
	//alert("OnExit fuct :"+popCookie+ "  Name:" + win_name+ "  Option:" + winoption+ "  Event:" + loadevent);
	checkCount(popCookie,win_name,winoption,loadevent)
}

function checkClosed()
{
	if(window.screenTop>10000)
	{
		DeleteCookie("corpbnr");
		var x=screen.width;
		var y=screen.height; positn="left="+Math.floor((x-641)/2)+",top="+Math.floor((y-583)/2);
		var windowprops="resizable=yes,width=641,height=583,"+positn+",scrollbars=yes";
		var win=window.open("http://web.refleks.com/index.php?surveyid=11667&newlang=en&refc=Corporate","Survey1",windowprops);
		if(window.opener)
			window.opener.focus();
	}		
}

window.onunload=checkClosed;
*/

function popUp(mb,movie){
var mb=mb;
var movie=movie;

var popup = window.open("","Lumina","width=505,height=400,left=150,top=120" )

var html="<link rel='stylesheet' href='/content_data/LAAM/ME/en/GBPME/999/includes/fonts.css' type='text/css'><title>Welcome to GMArabia.com - Chevrolet Lumina<"+"/title>"+
"<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>"+
"<table width='100%' border='0' cellpadding='0' cellspacing='0'>"+
"  <tr> "+
"    <td width='5%' valign='top'><img src='/content_data/LAAM/ME/en/GBPME/999/images/gmlogo.gif' width='44' height='43' border='0'><"+"/td>"+
   " <td valign='top'><img src='images/spacer.gif' width='2' height='1'><"+"/td>"+
"    <td width='94%' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
"        <tr> "+
"          <td width='139' height='20' align='Left' bgcolor='#003063'> <img "+"src='/content_data/LAAM/ME/en/GBPME/999/images/gcc_corp_site.gif' width='75' height='13' border='0'>&nbsp; "+
"          <"+"/td>"+
"          <td width='233' align='right' bgcolor='#003063'>&nbsp;<"+"/td>"+
"        <"+"/tr>"+
"        <tr> "+
"          <td height='23' align='left' bgcolor='#9CCFFF'>&nbsp; <img src='/content_data/LAAM/ME/en/GBPME/999/images/spacer.gif' "+"height='6' width='1'> "+
"          <"+"/td>"+
"          <td align='right' bgcolor='#9CCFFF'>&nbsp;<"+"/td>"+
"        <"+"/tr>"+
"      <"+"/table><"+"/td>"+
"  <"+"/tr>"+
"<"+"/table>"+
"<TABLE WIDTH='100%' BORDER='0' CELLSPACING='1' CELLPADDING='1'>"+
  "<TR bgcolor='#FF9A00'>"+ 
    "<TD height='25' colspan='2' align='center' class='black12b'><font color='#FFFFFF' size='3' face='Arial, Helvetica, sans-serif'>Video "+"Vault - Chevrolet Lumina</font></TD>"+
  "</TR>"+
  "<TR>"+ 
    "<TD height='280' colspan='2' align='center'><br>"+
	"<embed src='/content_data/LAAM/ME/en/GBPME/tvcommercials/chevrolet/"+mb+"mb/"+movie+".mpg' width='347' height='262'><"+"/embed>"+
      "<BR>"+ 
    "</TD>"+
  "</TR>"+
  "<TR>"+ 
    "<TD width='93%' align='center'>&nbsp;</TD>"+
    "<TD width='7%' align='center'>&nbsp;</TD>"+
  "</TR>"+
"</TABLE>"+
"<table width='100%' cellpading='0', cellspacing='0' border='0' cellpadding='0'>"+
  "<tr>"+ 
    "<td height='17' align='center' class='grey10'><a href='javascript:window.close();' class='black11b' >[Close]</a></td>"+
  "</tr>"+
"</table>"+
"<"+"/body>"
popup.document.open();
popup.document.write(html);
}

function sts_content()
{
	document.write("<span class='blue11dark'><br>"+
"INTUITIVE PERFORMANCE Performance-tuned at the famed Nurburgring race circuit in Germany, STS has been created to produce the vigorous acceleration, dynamic cornering, and confident braking of a no-compromise sports sedan. So responsive to your commands that it seems to anticipate your intentions, this is a car that will make your desires come true right before your eyes, ears, fingertips, and especially your right foot. The road doesn't stand a chance.</span>")
}

function showroom_advisor()
{

if(ctryCd=="EG")
{
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"+
" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='617' height='430'>"+
"                <param name='movie' value='/content_data/LAAM/ME/en/GBPME/999/flash/showroom_advisor_en_eg.swf?cntryCD="+ctryCd+"&mode=local'>"+
"                <param name='quality' value='high'>"+
"                <embed src='/content_data/LAAM/ME/en/GBPME/999/flash/showroom_advisor_en_eg.swf?cntryCD="+ctryCd+"&mode=local' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='617' height='430'></embed></object>")
}
else if(ctryCd=="IQ")
{
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"+
" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='617' height='430'>"+
"                <param name='movie' value='/content_data/LAAM/ME/en/GBPME/999/flash/showroom_advisor_en_iq.swf?cntryCD="+ctryCd+"&mode=local'>"+
"                <param name='quality' value='high'>"+
"                <embed src='/content_data/LAAM/ME/en/GBPME/999/flash/showroom_advisor_en_iq.swf?cntryCD="+ctryCd+"&mode=local' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='617' height='430'></embed></object>")
}
else
{
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"+
" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='617' height='430'>"+
"                <param name='movie' value='/content_data/LAAM/ME/en/GBPME/999/flash/showroom_advisor_en.swf?cntryCD="+ctryCd+"&mode=local'>"+
"                <param name='quality' value='high'>"+
"                <embed src='/content_data/LAAM/ME/en/GBPME/999/flash/showroom_advisor_en.swf?cntryCD="+ctryCd+"&mode=local' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='617' height='430'></embed></object>")
}
}

function populateDealerLocator(){
	
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='630' height='420' id='GMME_DL_Prototype' align='middle'>"+
		"<param name='allowScriptAccess' value='sameDomain' />"+
		"<param name='movie' value='/content_data/LAAM/ME/en/GBPME/999/flash/GMME_Dealerlocator.swf?model=local&namplt_cd=&cntry_cd="+ctryCd+"'/>"+
		"<param name='quality' value='high' />"+
		"<param name='bgcolor' value='#ffffff' />"+
		"<embed src='/content_data/LAAM/BV/en/GBPBV//999/flash/GMME_Dealerlocator.swf?model=local&namplt_cd=&cntry_cd="+ctryCd+"' quality='high' bgcolor='#ffffff' width='690' height='420' name='GMME_DL_Prototype' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
		"</object>");
}

function call_lumina_coupe()
{
location.href='/content_data/LAAM/'+ctryCd+'/en/GBP'+ctryCd+'/chevrolet/models/lumina/lumina_coupe.htm';

}


//arabic page call
function goArabic() {
	var param="";
	var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			param=ampSpl[i];
			cntcode=param.split("=");
			cntcode=cntcode[1];
			break;
		}
	}
	location.href="/content_data/LAAM/ME/ar/GBPME/999/"+cntcode+"/index.html?"+param;

}





//Temporary Accessory page calling method
function goBrand() {
if(ctryCd != "IQ")
{
	var param="";
	var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			param=ampSpl[i];
			break;
		}
	}
	//location.href="/content_data/LAAM/ME/en/GBPME/999/G1/Brand.html?"+param;
	alert("Accessories section will be available shortly");
}
else
{
	alert("Accessories is not available in Iraq")
}
}

function goTo() {
	/*var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	if(str != "") 
		location.href="/content_data/LAAM/ME/en/GBPME/999/G1/Brand.html?"+str;
	else 
		location.href="/content_data/LAAM/ME/en/GBPME/999/G1/Brand.html?cntryCd=SA";*/
		alert("Accessories section will be available shortly");
}

function populate_Accessory()
{
//document.write("Mathan")
/*document.write("<tr>"+
"<td height='18'>&nbsp;</td>"+
"<td><a href='javascript:goBrand()'><img"+
"src='/content_data/LAAM/ME/en/GBPME/999/G1/images/left_nav_accessories.gif' name='accessories' width='150' height='19'"+
"border='0' id='accessories' onMouseOver='MM_swapImage('accessories','','images/left_nav_accessories_off.gif',1)'"+ "onMouseOut='MM_swapImgRestore()'></a></td>"+
"</tr>")*/
}


//kkkk

var gblcat="";
var setfl=0;
var gblitm="";
var gblcat1="";
var gblFlag=false; //This flag is to determine whether the last element printed for the first iteration is category name or not
//kk
function displayAcc(myUrl,index) {
	
	
var nodearr=new Array();
var nodeindx=new Array();
var tempName="";
var nspl=new Array();
	
	var countryCode="";
	var brandCode="";
	var modelCode="";
	var year="";
	//var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			countryCode=vals[1];
		}
		else if(vals[0] == "brand" && vals[1] != "") {
			brandCode=vals[1];
		}
		else if(vals[0] == "model" && vals[1] != "") {
			modelCode=vals[1];
		}
		else if(vals[0] == "year" && vals[1] != "") {
			
			year=vals[1]; //Year is hard coded, in feature any accessories addded for 2007, pl change the year as 2007 manually
			//alert(year);
		}
	}
	
	
	//alert(glYear);
	if(year=="") year=glYear;
	
	//kk 27/7/06
xmlDoc.load("/content_data/LAAM/ME/en/GBPME/includes/"+brcode+"_"+year+"_accessoryData.xml");
	var cnt=0;
	var nodes11=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category/@name");


for (x=0;x<nodes11.length;x++) {
	nodearr[cnt]=nodes11[x].text;
	nodeindx[x]=nodes11[x].text;
	catName=nodes11[x].text;
	cnt=cnt+1;


var nodes21=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails/@id")

	var accId1="";
	var accId11;

	for (y=0;y<nodes21.length;y++) {
		accId11=nodes21[y].text;
		if (accId1!=accId11){
		var nodes221=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails[@id='"+accId11+"']/@PackageDescription")
			nodearr[cnt]=accId11+"&"+nodes221[0].text; 
		cnt+=1;

		accId1=accId11;}
	}
}

	




document.write('<table width=100%  border=0 cellPadding=2 cellSpacing=0 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">');
//document.write('<tr><td id="td1"></td><td id="td2"></td></tr>');
var rowNo=0;
var rowControl=(cnt/2);//alert(nodearr[4]);
var colNo=0;
var colControl=0;
var colLimit=2
//var flag=false;
var templink="";
var colcnt=0;
var xx=0;

var flg=0;
var y=0;
var x=0;
var offset=0;
var endIndex;
var pos=0;

if(index==2) {
	
	offset=parseInt(nodearr.length/2,0);
	offset+=1;

	endIndex=nodearr.length;
	
}
else
{
	 offset=0;
	 endIndex=parseInt(nodearr.length/2,0);
	 endIndex+=1;
}
	//For Second Iteration, Need to print Category name.. continued if the next element is not a category name
		if(index==2){
			var flag=true;
				for(y=0;y<nodeindx.length;y++){
					if(nodearr[offset]==nodeindx[y])					
					flag=false;
				}
				if(flag)
				{
					if(gblFlag){
					document.write('<tr><td><span class=black11b>&nbsp;'+gblcat1+'</span>');
					templink=gblcat1;
					}
					else{					
					document.write('<tr><td><span class=black11b>&nbsp;'+gblcat1+'</span><span class=style6> Continued..</span>');
					templink=gblcat1;
					}
				}
		}
	for(x=offset;x<endIndex;x++)
		{
			flg=0;
			for(y=0;y<nodeindx.length;y++)			
			{
					 if (nodearr[x]==nodeindx[y])
					{  
					if(x!=endIndex-1){
							var tempName="";
								if(nodearr[x]=="CargoManagement")
									{
										gblcat=nodearr[x]; templink=nodearr[x];
								tempName="Cargo Management";
								document.write("<tr align=left><td class=black11b>&nbsp;"+tempName+"</td></tr>"); flg=1;

									}
									
								
								else if(nodearr[x]=="BedProducts")
								{
								gblcat=nodearr[x];templink=nodearr[x];
								tempName="Bed Products";
								document.write("<tr align=left><td class=black11b>&nbsp;"+tempName+"</td></tr>"); flg=1;
					
								}else{
								gblcat=nodearr[x];templink=nodearr[x];											
								document.write("<tr align=left><td class=black11b>&nbsp;"+nodearr[x]+"</td></tr>"); flg=1;					
								}
						//For First Iteration Only..The last Printed Category Name is stored in global variable
						if(index==1)
						{
 							gblcat1=nodeindx[y];

						}
					  }else //If the last element for first first index is Category Element
					  {		flg=1;				  
						   gblcat1=nodeindx[y];
						   gblFlag=true;
					  }
					  
					}
			
			}		
						
						
						
			if(flg!=1)
			{


				 nspl=nodearr[x].split("&");

				document.write("<tr><td valign=top><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='2%' valign=top><img src='/content_data/LAAM/ME/en/GBPME/999/images/arrow.gif' ></td><td width='92%'><a class='style6' href=javascript:goTo('"+modelCode+"','"+templink+"','"+nspl[0]+"')>"+nspl[1]+"</a></td></tr></table></td></tr>");

				
			}
}

			

if(index==2){ gblcat1="";}

document.write("</table>");

}






// acc desc fuctions
function goBrand1(x)
{
	brand=x;
	location.href="Brand.html?cntryCd="+ctryCd+"&brand="+brand+"&menu=Y";
	
	
}

function getBrandModelName(obj) {
	var countryCode="";
	var brandCode="";
	var modelCode="";
	var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			countryCode=vals[1];
		}
		else if(vals[0] == "brand" && vals[1] != "") {
			brandCode=vals[1];
		}
		else if(vals[0] == "model" && vals[1] != "") {
			modelCode=vals[1];
		}
	}
	if(obj == "Brand") {
		var brandNode=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/@Name");
		if(brandNode.length > 0) {
			
			document.write("<a href=javascript:goBrand1('"+brandCode+"') style='color:#333333;TEXT-DECORATION: underline'>"+brandNode[0].text);
		}
		else document.write("");
	}
	else if(obj == "Model") {
		var mname=""; var i=0;
		var modelNode=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/@Name");
		if(modelNode.length > 0) {
		var mspl=modelNode[0].text;
			mspl=mspl.split(" "); for(i=1;i<mspl.length;i++) {mname+=mspl[i]+" ";}
			//mspl=mspl[1];
			document.write(mname);
		}
		else document.write("");
	}
}


function displayAccessory() {


	var countryCode="";
	var brandCode="";
	var modelCode="";
	var year="";
	var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			countryCode=vals[1];
		}
		else if(vals[0] == "brand" && vals[1] != "") {
			brandCode=vals[1];
		}
		else if(vals[0] == "model" && vals[1] != "") {
			modelCode=vals[1];
		}
		else if(vals[0] == "year" && vals[1] != "") {
			year=vals[1];
		}
	}
	//alert(modelCode);
	if(year=="") year=glYear;
	//alert(countryCode);
	
	//kk

	var cnt=0;
	var nodes11=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category/@name");


for (x=0;x<nodes11.length;x++) {
	catName=nodes11[x].text;
	cnt=cnt+1;

	var nodes21=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails/@id")

	var accId1="";
	var accId11;
	
	for (y=0;y<nodes21.length;y++) {
		accId11=nodes21[y].text;
		if (accId1!=accId11){
		var nodes221=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails[@id='"+accId11+"']/@PackageDescription")
//var	des	=nodes221[0].text;
		cnt+=1;
		accId1=accId11;}
	}
}

	
	
	//kk
	
	
	
	
	var nodes1=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category/@name");
//var nodes1=xmlDoc.selectNodes("/AccessoryData/Country[@code='IQ']/Brand[@code='005']/Model[@code='Model19']/Year[@code='2005']/AccessoriesDetail/Category/@name")
//alert(nodes1.length);
var len=3;

document.write('<TABLE width=100% height="235" border=0 cellPadding=0 cellSpacing=0  style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 25px; PADDING-TOP: 0px"><TBODY><tr>');
var rowNo=0;
var rowControl=(cnt*2)+2;//alert(cnt/3);
var colNo=0;
var colControl=0;
var colLimit=2;
var flag=false;
for (x=0;x<nodes1.length;x++) {
	var catName=nodes1[x].text;

	if(rowNo%rowControl == 0) {
		//if(rowNo > 0 && !flag)document.write("</table>");
		flag=false;
		if(colControl < colLimit) {
			colControl=colControl+1;
			document.write("<TD width=200 height=235 vAlign=top><table width=100% border=0 cellspacing=0 cellpadding=0 >");
			//alert("1 : "+colControl);
		}
	}
//"<tr><td><span class='txtblueForm'><img src='../images/spacer.gif' width='5' height=8></span></td><td class=arialblackbold width=750>"+tempName+" </td></tr>"	
	if(catName=="CargoManagement")
{
	tempName="Cargo Management";
	document.write("<tr><td width='5%'>&nbsp;</td><td width='90%' class='black11b'>"+tempName+"</td></tr>");
}
else if(catName=="BedProducts")
{
	tempName="Bed Products";
	document.write("<tr><td width='5%'>&nbsp;</td><td width='90%' class='black11b' >"+tempName+"</td></tr>");
}
else{

document.write("<tr><td width='5%'>&nbsp;</td><td width='90%' class='black11b'>"+catName+"</td></tr>");
}

//	document.write("<tr><td width='5%'>&nbsp;</td><td width='90%' class='black11b'>"+catName+"</td></tr>");
	rowNo=rowNo+1;
	if(rowNo%rowControl == 0) {
		if(colControl < colLimit) {
			document.write("</table></td><TD width=200 height=235 vAlign=top><table width=100% border=0 cellspacing=0 cellpadding=0 class='grey11'>");
			colControl=colControl+1;
			//alert("2 : "+colControl);
		}
		
	}

	var node222="";
	var gety="";
	var nodes2=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails/@id")

//	| /AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails/@PackageDescription")//Description

accId1="";

	
	for (y=0;y<nodes2.length;y++) {
		//accId1=accId; 
		accId=nodes2[y].text; 

		//y=y+1;
		//accDes=nodes2[y].text;
		
			//alert(y);
		var nodes22=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails[@id='"+accId+"']/@PackageDescription")



		if (accId1!=accId){
		var nodes22=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+catName+"']/accessoryDetails[@id='"+accId+"']/@PackageDescription")
		
		document.write("<tr><td align=right valign=top><img src='/content_data/LAAM/ME/en/GBPME/999/images/arrow.gif' ></td><td valign=top><a class='style6' href=javascript:goTo('"+catName+"','"+accId+"')>"+nodes22[0].text+"</a></td></tr>"); accId1=accId;}
		
		
		
		
		
		
		
		
		
		rowNo=rowNo+1;
		if(rowNo%rowControl == 0) {
			//alert(colControl);
			if(colControl < colLimit) {
		if(catName=="CargoManagement")
{
	tempName="Cargo Management";
	document.write("</table></td><TD width=200 height=235 vAlign=top><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width='12%'>&nbsp;</td><td width='90%' valign=top><span class='black11b'>"+tempName+" </span><span class='style6'>Continued</span></td></tr>");
}
else if(catName=="BedProducts")
{
	tempName="Bed Products";
	document.write("</table></td><TD width=200 height=235 vAlign=top><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width='12%'>&nbsp;</td><td width='90%' valign=top><span class='black11b'>"+tempName+" </span><span class='style6'>Continued</span></td></tr>");
}
else
{

document.write("</table></td><TD width=200 height=235 vAlign=top><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width='12%'>&nbsp;</td><td width='90%' valign=top><span class='black11b'>"+catName+" </span><span class='style6'>Continued</span></td></tr>");
}
		
//				document.write("</table></td><TD width=200 height=235 vAlign=top><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width='12%'>&nbsp;</td><td width='90%' ><span class='style6'>"+catName+" </span><span class='style6'>Continued</span></td></tr>");
				rowNo=rowNo+1;
				colControl=colControl+1;
			}		
		}
	}
		

	if(rowNo%rowControl == 0) {
		if(colControl < colLimit) {
			document.write("</table></td>");
			flag=true;
		}
	}
	
}
document.write("</table></td></tr></tbody></table>");

}

//acc-detail prnt
function displayPartNumber() {
	var countryCode="";
	var brandCode="";
	var modelCode="";
	var category="";
	var accId="";
	var year="";
	var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			countryCode=vals[1];
		}
		else if(vals[0] == "brand" && vals[1] != "") {
			brandCode=vals[1];
		}
		else if(vals[0] == "model" && vals[1] != "") {
			modelCode=vals[1];
		}
		else if(vals[0] == "category" && vals[1] != "") {
			category=vals[1];
		}
		else if(vals[0] == "accId" && vals[1] != "") {
			accId=vals[1];
		}
		else if(vals[0] == "year" && vals[1] != "") {
			year=vals[1];
		}

	}
	//alert(countryCode);
	var nodes1=xmlDoc.selectNodes("/AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+category+"']/accessoryDetails[@id='"+accId+"']/@Name | /AccessoryData/Brand[@code='"+brandCode+"']/Model[@code='"+modelCode+"']/Year[@code='"+year+"']/AccessoriesDetail/Category[@name='"+category+"']/accessoryDetails[@id='"+accId+"']/@PartNumber");
	document.write("<table width=100% cellspacing=0 cellpadding=3>");
	for(x=0;x<nodes1.length;x++) {
		document.write("<tr>");
		var part=nodes1[x].text;
		x=x+1;
		var desc=nodes1[x].text;
		
		document.write("<td width=2 bgcolor=#ffffff ><TD bgColor=#ffffff class='grey11' width=38% valign=top >"+desc+"</td></td>");
		document.write("<td width=12 bgcolor=#ffffff ><TD bgColor=#ffffff class='grey11' valign=top>"+part+"</td></td>");
		
		
		
		//document.write("<TD width=40% bgColor=#ffffff class='grey11'>"+desc+"</td>");
		//document.write("<TD width=60% bgColor=#ffffff class='grey11'>"+part+"</td>");
		document.write("</tr>");
	}
	document.write("</table>");

}


function goBrandModel(myUrl) {
	var ctCode="";
	var bCode="";
	var mCode="";
	
	var myUrl = document.location+""; 
	var spl=myUrl.split("?");
	var str=spl[1];
	if(str == undefined) str="";
	var ampSpl=str.split("&");
	for(i=0;i<ampSpl.length;i++) {
		var vals=ampSpl[i].split("=");
		if(vals[0] == "cntryCd" && vals[1] != "") {
			ctCode=vals[1];
		}
		else if(vals[0] == "brand" && vals[1] != "") {
			bCode=vals[1];
		}
		
	}
	
	//location.href="/content_data/LAAM/ME/en/GBPME/999/G1/Brand.html?cntryCd="ctCode+"&brand="+bCode;
	showModel("'+ctCode+'","'+bCode+'");
}

function goChevyLumina()
{
	var BaseURL="http://www.chevroletarabia.com/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=RequestBrochure&NampltCd=001^pageredirect&SellingSrc=72&cnInput=001/1L/1L_home.html^"+ctryCd;
	window.open(BaseURL);
}

// Modified by Satyam Please DO NOT OVERWRITE
function download_eBrochure(){
	if(ctryCd!="EG")
	{
		var width = 594;
	var height = 716;
	var left = (window.screen.width-width) / 2;
	var top = (window.screen.height-height) / 2;
	var features = "top="+top+",left="+left+",width="+width+",height="+height+",resizable=no,location=no,scrollbars=no,toolbar=no,menubar=no"
	//var address = "/content_data/LAAM/ME/en/GBPME/999/G1/ebrochure.html?cntryCd="+ctryCd+"&brand=";
	var address = "http://www.globalbuypower.com/content_data/LAAM/ME/en/GBPME/999/G1/ebrochure.html?cntryCd="+ctryCd;
	disWindow = window.open(address, "disclaimer", features);
	}
	else{
	var width = 594;
	var height = 716;
	var left = (window.screen.width-width) / 2;
	var top = (window.screen.height-height) / 2;
	var features = "top="+top+",left="+left+",width="+width+",height="+height+",resizable=no,location=no,scrollbars=no,toolbar=no,menubar=no"
	//var address = "/content_data/LAAM/ME/en/GBPME/999/G1/ebrochure.html?cntryCd="+ctryCd+"&brand=";
	var address = "/GBPServiceMgr2.dyn?CntryCd=ME&LangCd=en&WebSiteID=GBPME&ReqsType=Pull&ServiceName=TestDrive&NampltCd=999^^DEB^N^EG^&SellingSrc=72&MerchModlDesgtr=BSE&ModelCode=1B ";
	disWindow = window.open(address, "disclaimer", features);
}
}