

function chgTheme (theme) {
	if ((xTheme!=theme)||(xThemeOverride!='')) {
		xTheme=theme; 
		if (xThemeOverride!="") xTheme=xThemeOverride;	
		var s;
		var i;
		var e1=document.getElementById("TopSection");  	
		var e2=recreateDiv('div_Logo','');	
		if (xBrighterLogo==true) {
		  e2.style.backgroundColor="#F5EED5";
		  e2.style.borderColor="#FFFFFF";
		}
		var e3=document.getElementById("div_OfferPic");  				
		var e31=e3.firstChild;
		var save_OfferPic_here="";
		if (e31==null)
		  save_OfferPic_here=e3.style.backgroundImage;
		else  
		  save_OfferPic_here=e31.style.backgroundImage;
		e3=recreateDiv('div_Offer',save_div_Offer_innerHTML);
		
		
		var e4=document.getElementById("OfferName");
		if (xTourID=="0") {
		  var e5=document.getElementById("ActualTours_caption");  				
          var e6=document.getElementById("ActualTours_content_table");  								
		  var e6_arr=getElmntsByClassName(e6,"ActualTourRow");
		  e6=document.getElementById("ActualTours_frame");  						
		}
		else {
		  var e7=document.getElementById("BottomSection");  				
		}
		switch (xTheme) {
		  case "WH": e1.style.background="#E0D5B8 url(images/hdrbk_wh.jpg) repeat-x";         
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#E0D5B8"; 
					   e2.style.borderColor="#F0E5C8";				 
					 }
					 e3.style.backgroundColor="#E0D5B8"; 
					 e3.style.borderColor="#F0E5C8";				 				 
					 e4.style.backgroundColor="#D6CAAC";
					 e4.style.borderLeftColor  ="#C9C0A2"; 
					 e4.style.borderTopColor   ="#C9C0A2";				 
					 e4.style.borderRightColor ="#EBE1C4"; 
					 e4.style.borderBottomColor="#EBE1C4"; 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#C5B18E";
					   e6.style.backgroundColor="#D4C4A2";						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#D4C4A2"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#F2ECD5";	
					   e7.style.borderBottomColor="#DED1AE";				   
					 }
					 break;							 				 					 
		  case "YE": e1.style.background="#FADF66 url(images/hdrbk_ye.jpg) repeat-x";         
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#FADF66"; 
					   e2.style.borderColor="#FFF6C0";				 
					 }
					 e3.style.backgroundColor="#FADF66"; 
					 e3.style.borderColor="#FFF6C0";				 				 
					 e4.style.backgroundColor="#F9D748";
					 e4.style.borderLeftColor  ="#F3D142"; 
					 e4.style.borderTopColor   ="#F3D142";				 
					 e4.style.borderRightColor ="#FFE557"; 
					 e4.style.borderBottomColor="#FFE557"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#F4C908";
					   e6.style.backgroundColor="#FADF66";						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#FADF66"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#FBE58D";				   
					   e7.style.borderBottomColor="#D3C8AB";				   				   
					 }
					 break;							 				 					 			
		  case "OR": e1.style.background="#FBD273 url(images/hdrbk_or.jpg) repeat-x";         
					 if (xColorLogo==true) { 
					   e2.style.backgroundColor="#FBD273"; 
					   e2.style.borderColor="#FFE5AA";				 
					 }
					 e3.style.backgroundColor="#FBD273"; 
					 e3.style.borderColor="#FFE5AA";				 				 
					 e4.style.backgroundColor="#F5CA69";
					 e4.style.borderLeftColor  ="#F2C242"; 
					 e4.style.borderTopColor   ="#F2C242";				 
					 e4.style.borderRightColor ="#FDDB94"; 
					 e4.style.borderBottomColor="#FDDB94"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#FFC663"; 
					   e6.style.backgroundColor="#FBD273"; 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#FBD273"; }
					 }
					 else {
					   e7.style.backgroundColor="#FFD587";				   				   				   				   
					   e7.style.borderBottomColor="#D3C8AB";				   				   
					 }
					 break;
		  case "BR": e1.style.background="#E8CC9B url(images/hdrbk_br.jpg) repeat-x";         
					 if (xColorLogo==true) { 					 
					   e2.style.backgroundColor="#E8CC9B"; 
					   e2.style.borderColor="#F4D8A7";				 
					 }
					 e3.style.backgroundColor="#E8CC9B"; 
					 e3.style.borderColor="#F4D8A7";				 				 
					 e4.style.backgroundColor="#E0C493";
					 e4.style.borderLeftColor  ="#DABE8E"; 
					 e4.style.borderTopColor   ="#DABE8E";				 
					 e4.style.borderRightColor ="#EED29E"; 
					 e4.style.borderBottomColor="#EED29E"; 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#E7BB81"; 
					   e6.style.backgroundColor="#E8CC9B"; 						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#E8CC9B"; }
					 }
					 else {
					   e7.style.backgroundColor="#E7CA97";					   
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;						 
		  case "CR": e1.style.background="#FFCE99 url(images/hdrbk_cr.jpg) repeat-x";         
					 if (xColorLogo==true) { 					 
					   e2.style.backgroundColor="#FFCE99"; 
					   e2.style.borderColor="#FFE4C4";				 
					 }
					 e3.style.backgroundColor="#FFCE99"; 
					 e3.style.borderColor="#FFE4C4";				 				 
					 e4.style.backgroundColor="#F6C58F";
					 e4.style.borderLeftColor  ="#F0C080"; 
					 e4.style.borderTopColor   ="#F0C080";				 
					 e4.style.borderRightColor ="#F9D7AA"; 
					 e4.style.borderBottomColor="#F9D7AA"; 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#FFBE83"; 
					   e6.style.backgroundColor="#FFCE99"; 						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#FFCE99"; }
					 }
					 else {
					   e7.style.backgroundColor="#FFCD9A";					   
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;	
		  case "RD": e1.style.background="#FFBA93 url(images/hdrbk_rd.jpg) repeat-x";         
					 if (xColorLogo==true) { 					 
					   e2.style.backgroundColor="#FFBA93"; 
					   e2.style.borderColor="#FFD5B0";				 
					 }
					 e3.style.backgroundColor="#FFBA93"; 
					 e3.style.borderColor="#FFD5B0";				 				 
					 e4.style.backgroundColor="#F8AD86";
					 e4.style.borderLeftColor  ="#F0A37A"; 
					 e4.style.borderTopColor   ="#F3A67D";				 
					 e4.style.borderRightColor ="#F9C3A0"; 
					 e4.style.borderBottomColor="#F9C3A0"; 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#FF9D77"; 
					   e6.style.backgroundColor="#FFBA93"; 						 						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#FFBA93"; }					   
					 }
					 else {
					   e7.style.backgroundColor="#FFD0AD";					   				   
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;					 
		  case "PI": e1.style.background="#F9D9D0 url(images/hdrbk_pi.jpg) repeat-x";         
					 if (xColorLogo==true) { 					 
					   e2.style.backgroundColor="#F9D9D0"; 
					   e2.style.borderColor="#FFE4C4";			
					 }
					 e3.style.backgroundColor="#F9D9D0"; 
					 e3.style.borderColor="#FFE4C4";				 				 
					 e4.style.backgroundColor="#F3D3C9";
					 e4.style.borderLeftColor  ="#ECCCC2"; 
					 e4.style.borderTopColor   ="#ECCCC2";				 
					 e4.style.borderRightColor ="#FDE2DB"; 
					 e4.style.borderBottomColor="#FDE2DB"; 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#F0C7C7"; 
					   e6.style.backgroundColor="#F9D9D0"; 						 						 						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#F9D9D0"; }					   
					 }
					 else {
					   e7.style.backgroundColor="#F6D0C5";					   
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;					 
		  case "VI": e1.style.background="#D5CEEB url(images/hdrbk_vi.jpg) repeat-x";         
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#D5CEEB"; 
					   e2.style.borderColor="#E4E1F1";				 
					 }
					 e3.style.backgroundColor="#D5CEEB"; 
					 e3.style.borderColor="#E4E1F1";				 				 
					 e4.style.backgroundColor="#CEC7E4";
					 e4.style.borderLeftColor  ="#C7C0DD"; 
					 e4.style.borderTopColor   ="#C7C0DD";				 
					 e4.style.borderRightColor ="#DCD5F2"; 
					 e4.style.borderBottomColor="#DCD5F2"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#C6BFDC";
					   e6.style.backgroundColor="#D5CEEB"; 						 						 						
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#D5CEEB"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#CCC3FF";	
					   e7.style.borderBottomColor="#C0B59F";				   
					 }
					 break;					 
		  case "BL": e1.style.background="#CDDEFF url(images/hdrbk_bl.jpg) repeat-x";         
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#CDDEFF"; 
					   e2.style.borderColor="#E0F0FF";				 
					 }
					 e3.style.backgroundColor="#CDDEFF"; 
					 e3.style.borderColor="#E0F0FF";				 				 
					 e4.style.backgroundColor="#C2D8F2";
					 e4.style.borderLeftColor  ="#BFD0F2"; 
					 e4.style.borderTopColor   ="#BFD0F2";				 
					 e4.style.borderRightColor ="#D6E6FD"; 
					 e4.style.borderBottomColor="#D6E6FD"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#B9D0F0";
					   e6.style.backgroundColor="#CDDEFF";
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#CDDEFF"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#D0DCFD";	
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;				 
		  case "CY": e1.style.background="#A1E8FF url(images/hdrbk_cy.jpg) repeat-x";         
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#A1E8FF"; 
					   e2.style.borderColor="#E0FFFF";				 
					 }
					 e3.style.backgroundColor="#A1E8FF"; 
					 e3.style.borderColor="#E0FFFF";				 				 
					 e4.style.backgroundColor="#91E1F1";
					 e4.style.borderLeftColor  ="#83D8F3"; 
					 e4.style.borderTopColor   ="#83D8F3";				 
					 e4.style.borderRightColor ="#BAF0FA"; 
					 e4.style.borderBottomColor="#BAF0FA"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#7ED4DE"; 
					   e6.style.backgroundColor="#A1E8FF"; 					 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#A1E8FF"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#CCF8FF";					   
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;				 				 		 
		  case "TE": e1.style.background="#99FFC6 url(images/hdrbk_te.jpg) repeat-x";   
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#99FFC6"; 
					   e2.style.borderColor="#D6FFE0";
					 }
					 e3.style.backgroundColor="#99FFC6"; 
					 e3.style.borderColor="#D6FFE0";				 
					 e4.style.backgroundColor="#79DFB9";	
					 e4.style.borderLeftColor  ="#6DD49B"; 
					 e4.style.borderTopColor   ="#6FD69D";				 
					 e4.style.borderRightColor ="#B9FFE0"; 
					 e4.style.borderBottomColor="#B9FFE0"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#77D5AA";
					   e6.style.backgroundColor="#99FFC6"; 					 						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#99FFC6"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#C9FFC9";				 				 
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;	  		 				 
		  case "GR": e1.style.background="#B8E2A6 url(images/hdrbk_gr.jpg) repeat-x";   
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#B8E2A6"; 
					   e2.style.borderColor="#E0FFD6";
					 }
					 e3.style.backgroundColor="#B8E2A6"; 
					 e3.style.borderColor="#E0FFD6";				 
					 e4.style.backgroundColor="#ADD79B";	
					 e4.style.borderLeftColor  ="#A4CE8E"; 
					 e4.style.borderTopColor   ="#A4CE8E";				 
					 e4.style.borderRightColor ="#C2ECB1"; 
					 e4.style.borderBottomColor="#C2ECB1"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#95D68B";
					   e6.style.backgroundColor="#B8E2A6";
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#B8E2A6"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#C5E9AB";				 				 
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;	  		 				 					 
		  case "KO": e1.style.background="#BAD8B0 url(images/hdrbk_ko.jpg) repeat-x";   
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#BAD8B0"; 
					   e2.style.borderColor="#D2EEC7";
					 }
					 e3.style.backgroundColor="#BAD8B0"; 
					 e3.style.borderColor="#D2EEC7";				 
					 e4.style.backgroundColor="#B2D0A7";	
					 e4.style.borderLeftColor  ="#B2C89B"; 
					 e4.style.borderTopColor   ="#B2C89B";				 
					 e4.style.borderRightColor ="#C2E2B8"; 
					 e4.style.borderBottomColor="#C2E2B8"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#ACCAA1";
					   e6.style.backgroundColor="#BAD8B0";
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#BAD8B0"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#BBD2A6";				 				 
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;	  		 				 					 					 
		  case "PA": e1.style.background="#D8E591 url(images/hdrbk_pa.jpg) repeat-x";   
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#D8E591"; 
					   e2.style.borderColor="#EBFFD0";
					 }
					 e3.style.backgroundColor="#D8E591"; 
					 e3.style.borderColor="#EBFFD0";				 
					 e4.style.backgroundColor="#CAD980";	
					 e4.style.borderLeftColor  ="#C0C940"; 
					 e4.style.borderTopColor   ="#C0C940";				 
					 e4.style.borderRightColor ="#E0F4B0"; 
					 e4.style.borderBottomColor="#E0F4B0"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#C6D57C";
					   e6.style.backgroundColor="#D8E591";
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#D8E591"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#D6E997";				 				 
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;	  		 
		  case "OL": e1.style.background="#E1DB7D url(images/hdrbk_ol.jpg) repeat-x";   
					 if (xColorLogo==true) {
					   e2.style.backgroundColor="#E1DB7D"; 
					   e2.style.borderColor="#F0FFC0";
					 }
					 e3.style.backgroundColor="#E1DB7D"; 
					 e3.style.borderColor="#F0FFC0";				 
					 e4.style.backgroundColor="#DBD577";	
					 e4.style.borderLeftColor  ="#D4D06E"; 
					 e4.style.borderTopColor   ="#D4D06E";				 
					 e4.style.borderRightColor ="#E6E282"; 
					 e4.style.borderBottomColor="#E6E282"; 				 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#D0CB6C";
					   e6.style.backgroundColor="#E1DB7D";						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#E1DB7D"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#DFDB93";				 				 
					   e7.style.borderBottomColor="#D3C8AB";				   
					 }
					 break;	  		 				 
		  default  : xTheme="BE";
		             e1.style.background="#E0D5B8 url(images/hdrbk_be.jpg) repeat-x";         
				     if (xBrighterLogo==true) {
					   e2.style.backgroundColor="#F5EED5";
					   e2.style.borderColor="#FFFFFF";									   
					 }
					 else {
					   e2.style.backgroundColor="#E0D5B8"; 
					   e2.style.borderColor="#F0E5C8";				 
					 }
					 e3.style.backgroundColor="#E0D5B8"; 
					 e3.style.borderColor="#F0E5C8";				 				 
					 e4.style.backgroundColor="#D6CAAC";
					 e4.style.borderLeftColor  ="#C9C0A2"; 
					 e4.style.borderTopColor   ="#C9C0A2";				 
					 e4.style.borderRightColor ="#EBE1C4"; 
					 e4.style.borderBottomColor="#EBE1C4"; 
					 if (xTourID=="0") {
					   e5.style.backgroundColor="#C5B18E";
					   e6.style.backgroundColor="#D4C4A2";						 
					   for (i=1; i<=e6_arr.length; i++) { e6_arr[i-1].style.backgroundColor="#D4C4A2"; }					   					   
					 }
					 else {
					   e7.style.backgroundColor="#D4C4A2";	
					   e7.style.borderBottomColor="#C3B89B";				   
					 }
		}	
		curr_divOfferBkColor    = rgbConvert(e3.style.backgroundColor);
		curr_OfferNameBkColor   = rgbConvert(e4.style.backgroundColor);				
		if (xTourID!="0") curr_bottomSectionColor = rgbConvert(e7.style.backgroundColor);
		curvyCorners(cs_large, e2);
		curvyCorners(cs_large2, e3);		
		e3=recreateDiv('div_OfferPic','');		
	    e3.style.backgroundImage=save_OfferPic_here;
        curvyCorners(cs_offerpic, e3);   					

	}
}



function admin_ChgTheme (opr) {
	var drawElmnts=true;
    var e;  
    var f;  	
    var g=document.getElementById("td_ThemeGap");	
    var h=document.getElementById("td_ThemeGap2");		
    if (opr==0) {
	  e=trimStr(stripNewLineChars(g.innerHTML));
	  if ((e=="")||(e=="&nbsp;")) {	
        if (xThemeOverride!="") xTheme=xThemeOverride;	
	    xThemeOverride="";	  
	  }
	  else {
        g.innerHTML="&nbsp;";
        h.innerHTML="&nbsp;";		
		drawElmnts=false;
	  }
    }	  
    else {
	  if (opr==1) {	// backward
        switch (xTheme) {
	      case "WH" : chgTheme("BE"); break;		  		  			
	      case "BE" : chgTheme("OL"); break;		  	  				  			
	      case "OL" : chgTheme("PA"); break;				  
	      case "PA" : chgTheme("KO"); break;		
	      case "KO" : chgTheme("GR"); break;		  
	      case "GR" : chgTheme("TE"); break;	
	      case "TE" : chgTheme("CY"); break;		
	      case "CY" : chgTheme("BL"); break;	
	      case "BL" : chgTheme("VI"); break;	
	      case "VI" : chgTheme("PI"); break;		
	      case "PI" : chgTheme("RD"); break;			  
	      case "RD" : chgTheme("CR"); break;			  	  
	      case "CR" : chgTheme("BR"); break;			  	  	  
	      case "BR" : chgTheme("OR"); break;	
	      case "OR" : chgTheme("YE"); break;		  
	      case "YE" : chgTheme("WH"); break;		  			
        }
	  }
	  else {  // forward
        switch (xTheme) {
	      case "BE" : chgTheme("WH"); break;		  			
	      case "WH" : chgTheme("YE"); break;		  		  			
	      case "YE" : chgTheme("OR"); break;		  	  				  			
	      case "OR" : chgTheme("BR"); break;				  
	      case "BR" : chgTheme("CR"); break;		
	      case "CR" : chgTheme("RD"); break;		  
	      case "RD" : chgTheme("PI"); break;	
	      case "PI" : chgTheme("VI"); break;		
	      case "VI" : chgTheme("BL"); break;	
	      case "BL" : chgTheme("CY"); break;	
	      case "CY" : chgTheme("TE"); break;		
	      case "TE" : chgTheme("GR"); break;			  
	      case "GR" : chgTheme("KO"); break;			  	  
	      case "KO" : chgTheme("PA"); break;			  	  	  
	      case "PA" : chgTheme("OL"); break;	
	      case "OL" : chgTheme("BE"); break;		  
        }		  
	  }
	  var e;
      e=recreateDiv('div_OfferPic','');
	  e.style.backgroundImage=save_OfferPic;	
      curvyCorners(cs_offerpic, e);   			
      e=document.getElementById("OfferCaption");
      e.innerHTML=save_OfferCaption;
      e=document.getElementById("OfferName");
      e.innerHTML=save_OfferName;
      e=document.getElementById("OfferNotice");
      e.src=save_OfferNotice;  
    }	  
	if (drawElmnts==true) {
	  var i;
      switch (xTheme) {
	      case "BE" : i="01"; break;
	      case "WH" : i="02"; break;
	      case "YE" : i="03"; break;
	      case "OR" : i="04"; break;		  		  	  
	      case "BR" : i="05"; break;
	      case "CR" : i="06"; break;
	      case "RD" : i="07"; break;
	      case "PI" : i="08"; break;
	      case "VI" : i="09"; break;
	      case "BL" : i="10"; break;
	      case "CY" : i="11"; break;
	      case "TE" : i="12"; break;
	      case "GR" : i="13"; break;
	      case "KO" : i="14"; break;
	      case "PA" : i="15"; break;
	      case "OL" : i="16"; break;
      }		  	  		
	  var s;	
	  s = "<input id=\"label_ColorPicker0\" class=\"cls_ColorPickerLabel\" value=\"&nbsp;&nbsp;&nbsp;theme&nbsp;"+i+"\" readonly=\"readonly\" /><br>"+
		  "<input type=\"button\" value=\"save\" style=\"width:51px;font-size:10px;\" onclick=\"admin_SetTheme();\" /><br>"+	  
	      "<span style=\"font-size:30px;color:#FFFFFF;\">"+xTheme+"</span><br>"+
		  "<input type=\"button\" value=\"<<\" style=\"width:26px;font-size:10px;\" onclick=\"admin_ChgTheme(1);\" /><input type=\"button\" value=\">>\" style=\"width:26px;font-size:10px;\" onclick=\"admin_ChgTheme(2);\" /><br><br><br>"+
		  "<input id=\"label_ColorPicker1\" class=\"cls_ColorPickerLabel\" value=\"background\" readonly=\"readonly\" /><br>"+
		  "<input id=\"ColorPicker1\" class=\"ColorPicker {valueElement:'ColorPicker1',styleElement:'div_Offer'}\" type=\"text\" value=\""+curr_divOfferBkColor+"\" /><br><br>"+
		  "<input id=\"label_ColorPicker2\" class=\"cls_ColorPickerLabel\" value=\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title\" readonly=\"readonly\" /><br>"+
		  "<input id=\"ColorPicker2\" class=\"ColorPicker {valueElement:'ColorPicker2',styleElement:'OfferName'}\" type=\"text\" value=\""+curr_OfferNameBkColor+"\" />";
	  g.innerHTML=s;	  
	  s = "<input id=\"label_ColorPicker3\" class=\"cls_ColorPickerLabel\" value=\"background\" readonly=\"readonly\" /><br>"+
		  "<input id=\"ColorPicker3\" class=\"ColorPicker {valueElement:'ColorPicker3',styleElement:'BottomSection'}\" type=\"text\" value=\""+curr_bottomSectionColor+"\" /><br><br>";
	  h.innerHTML=s;	  
	  jscolor.bind();
	}

}


function admin_SetTheme () {
  jsrsExecute("scripts/fx_SetTheme.php", null_cb, "do_SetTheme", Array(xTourID,xTheme));    		  	
}



function admin_ShowOptions () {
  var f=document.getElementById("bt_admin_panel");  
  if (xTourID=="0")	{
	if (w_adminPanel) {
  	  f.value="open panel";		
	  w_adminPanel.close();
	}
    else {
  	  f.value="close panel";				
      w_adminPanel = showPopup(":: admin panel","cockpit/admin_panel_main.php?LN="+xLang,1,true,9,9,400,570,false); 
	  
	}
  }
  else{
    var s;	
	var i;
	var opts;
    var e=document.getElementById("div_Admin_in");
    if (e) {
	  if (e.style.visibility=="hidden") {
        f.value="close panel";				  
	    e.style.visibility="visible";			
	    e.parentNode.style.width="334px";
	    e.style.width="295px";	  
	    e=document.getElementById("adminElement_title");	  
	    e.value=xTourTitle;
	    e=document.getElementById("adminElement_language");	  
	    e.value=xLang;	  	  
	    e=document.getElementById("adminElement_id");	  
	    e.value=xTourID;	  	  
	    e=document.getElementById("adminElement_group");	  
	    e.value=xTourGroup;	  
	    e=document.getElementById("adminElement_idfier");	  
	    e.value=xTourIdfier;
		e=document.getElementById("adminElement_active");
		if (xTourDisabled=="0") e.checked="checked";
		e=document.getElementById("adminElement_offerable");
		if (xTourOfferable=="1") e.checked="checked";		
		e=document.getElementById("adminElement_listable");
		if (xTourListable=="1") e.checked="checked";				
		e=document.getElementById("adminElement_tour_CatSel");
		opts=e.getElementsByTagName('option');
		for (i=0; i<opts.length; i++) {
          if (opts[i].value.substr(11)==xTourCatID) {
		    opts[i].selected="selected";
		    break;
		  }
		}		
		e=document.getElementById("adminElement_tour_LocSel");
		opts=e.getElementsByTagName('option');
		for (i=0; i<opts.length; i++) {
          if (opts[i].value.substr(11)==xTourLocID) {
		    opts[i].selected="selected";
		    break;
		  }
		}
	    e=document.getElementById("adminElement_caption");
	    e.value=trimStr(stripNewLineChars(document.getElementById("OfferCaption").innerHTML));
	    e=document.getElementById("adminElement_name");
	    e.value=trimStr(stripNewLineChars(document.getElementById("OfferName").innerHTML));	  
	    e=document.getElementById("adminElement_notice");
	    s=document.getElementById("OfferNotice").style.backgroundImage;	  	  
	         if (s.indexOf('notice_new.')>=0)        s="$new";		
	    else if (s.indexOf('notice_bestoffer.')>=0)  s="$bestoffer";
	    else if (s.indexOf('notice_lastminute.')>=0) s="$lastminute";
	    else if (s.indexOf('notice_mostwanted.')>=0) s="$mostwanted";	
		else s=s.substring(5,s.length-2);  
	    e.value=s;
	    e=document.getElementById("adminElement_article");
	    e.value=trimStr(stripNewLineChars(document.getElementById("ArticleContent").innerHTML));
	    e=document.getElementById("adminElement_impression");
	    e.value=xTourImpression;		
	    e=document.getElementById("adminElement_LocLoc");
	    e.value=xLocURL_local;
	    e=document.getElementById("adminElement_GloLoc");
	    e.value=xLocURL_global;
	    e=document.getElementById("adminElement_LocMap");	  
	    e.value=xMapURL_local;
	    e=document.getElementById("adminElement_GloMap");	  
	    e.value=xMapURL_global;
	    e=document.getElementById("adminElement_LocDoc");	  
	    e.value=xDocURL_local;
	    e=document.getElementById("adminElement_GloDoc");	  
	    e.value=xDocURL_global;
	    e=document.getElementById("adminElement_LocDates");
	    e.value=xTourDates_local;
	    e=document.getElementById("adminElement_GloDates");
	    e.value=xTourDates_global;
	    e=document.getElementById("adminElement_LocPrices");	  
	    e.value=xTourPrices_local;	  	  	  	  
	    e=document.getElementById("adminElement_GloPrices");	  
	    e.value=xTourPrices_global;	  	  
	  }
	  else {
	    e.parentNode.style.width="0px";	  
	    e.style.width="0px";	  	  
	    e.style.visibility="hidden";		  
        f.value="open panel";				
	  }
    }
  }
}


function do_AdminOpr (e) {
  var aID_elmnt=document.getElementById("adminElement_id");	  
  var aID=stripHTML(convQuotes(trimStr(stripNewLineChars(aID_elmnt.value))));	
  var aLang_elmnt = document.getElementById("adminElement_language");	  	  
  var aLang=stripHTML(convQuotes(trimStr(stripNewLineChars(aLang_elmnt.value))));
  var e2;
  switch (e.id) {
    case "adminElement_reload" :
      var f=document.getElementById("div_Admin_in");
	  f.style.visibility="hidden";
	  admin_ShowOptions();	  
	  break;	
	case "adminElement_apply" :
	  if (aLang!=xLang) {
        if (confirm("You have changed the 'Language' value, but the data shown will be applied to the current '"+xLang+"' language version of the current tour displayed.\n\nDo you want to continue ?"))		  
		  adminOpr_SaveTour(e);
	  }
	  else
	    adminOpr_SaveTour(e);
	  break;		
	case "adminElement_clone" :	
      if (aLang==xLang) 
	    alert("You have to select a different 'Language' value to be cloned with this data.");
	  else {
	    if (confirm("The data shown will be applied to the '"+aLang+"' language version of the current tour displayed. If this language version already exists, it will be overwritten with this data.\n\nDo you want to continue ?"))		 
          adminOpr_SaveTour(e);
	  }
	  break;		  
	case "adminElement_new" :
      adminOpr_SaveTour(e);	
	  break;		  
	case "adminElement_delete" :  
  	  adminOpr_DeleteTour();
	  break;	
    case "adminElement_close" :
	  if (xTourID!="0") {
        var f=document.getElementById("bt_admin_panel");		
	    f.value="open panel";
	    admin_ShowOptions();
	  }
	  break;
    case "adminElement_LocDoc" :	  	  
    case "adminElement_GloDoc" :	  	
	  var s="?LN="+xLang;
	  var t="local brochure"
      if (e.id=="adminElement_GloDoc") {
		s="";
		t="global brochure"
	  }
      w_FileUpload = showPopup(":: "+t,"cockpit/admin_upload_file.php"+s,1,true,undefined,undefined,260,55,false);  	
	  break;	
  }
}


function adminOpr_SaveTour (f) {
  var e;
  var aTourID;
  var aTourIdfier;  
  var aLang;
  var aCreate;
  switch (f.id) {
	case "adminElement_apply" :
	  aCreate="0";		
	  aTourID=xTourID;
	  aLang=xLang;
	  break;
	case "adminElement_clone" :  
	  aCreate="1";	
	  aTourID=xTourID;
	  e=document.getElementById("adminElement_language");	  	  
	  aLang=stripHTML(convQuotes(trimStr(stripNewLineChars(e.value))));
	  break;
	case "adminElement_new" :
	  aCreate="2";
	  if (confirm("Do you want to use the data shown here, while creating the new tour ?\n(otherwise a blank tour will be created)")) {
	    aCreate="3";
	    aLang=xLang;		
	  }
	  else
	    aLang="TR";
	  aTourID="0";
	  break;		  
  }
  e=document.getElementById("adminElement_title");	  
  var aTitle=stripHTML(convQuotes(trimStr(stripNewLineChars(e.value))));  
  if (aCreate=="2") aTitle="new tour title";
  e=document.getElementById("adminElement_group");	    
  var aGroup=stripHTML(convQuotes(trimStr(stripNewLineChars(e.value))));
  if (aCreate=="2") aGroup="general";  
  e=document.getElementById("adminElement_idfier");	    
  var aTourIdfier=stripHTML(convQuotes(trimStr(stripNewLineChars(e.value))));
  if ((aCreate=="2")||(aCreate=="3")) aTourIdfier="";    
  e=document.getElementById("adminElement_tour_CatSel");	    
  var aCatID=e.value.substr(11);
  if (aCreate=="2") aCatID="1";      
  e=document.getElementById("adminElement_tour_LocSel");	      
  var aLocID=e.value.substr(11);
  if (aCreate=="2") aLocID="1";        
  e=document.getElementById("adminElement_active");	      
  var aDisabled = (e.checked==true)? "0": "1";  
  if (aCreate=="2") aDisabled="1";  
  e=document.getElementById("adminElement_offerable");	      
  var aOfferable = (e.checked==true)? "1": "0";    
  if (aCreate=="2") aOfferable="1";    
  e=document.getElementById("adminElement_listable");	      
  var aListable = (e.checked==true)? "1": "0";      
  if (aCreate=="2") aListable="1";      
  e=document.getElementById("adminElement_caption");
  var aCaption=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aCaption="";        
  e=document.getElementById("adminElement_name");
  var aName=convQuotes(trimStr(stripNewLineChars(e.value))); 	  
  if (aCreate=="2") aName="new tour name";          
  e=document.getElementById("adminElement_notice");
  var aNotice=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aNotice="";          
  e=document.getElementById("adminElement_article");
  var aArticle=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aArticle="";          
  e=document.getElementById("adminElement_impression");
  var aImpression=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aImpression="";            
  e=document.getElementById("adminElement_LocLoc");
  var aLoc_local=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aLoc_local="";          
  e=document.getElementById("adminElement_GloLoc");
  var aLoc_global=convQuotes(trimStr(stripNewLineChars(e.value)));  
  if (aCreate=="2") aLoc_global="";            
  e=document.getElementById("adminElement_LocMap");	  
  var aMap_local=convQuotes(trimStr(stripNewLineChars(e.value)));  
  if (aCreate=="2") aMap_local="";            
  e=document.getElementById("adminElement_GloMap");	  
  var aMap_global=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aMap_global="";            
  e=document.getElementById("adminElement_LocDoc");	  
  var aDoc_local=convQuotes(trimStr(stripNewLineChars(e.value)));  
  if (aCreate=="2") aDoc_local="";            
  e=document.getElementById("adminElement_GloDoc");	  
  var aDoc_global=convQuotes(trimStr(stripNewLineChars(e.value)));  
  if (aCreate=="2") aDoc_global="";            
  e=document.getElementById("adminElement_LocDates");
  var aDates_local=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aDates_local="";            
  e=document.getElementById("adminElement_GloDates");
  var aDates_global=convQuotes(trimStr(stripNewLineChars(e.value)));  
  if (aCreate=="2") aDates_global="";            
  e=document.getElementById("adminElement_LocPrices");	  
  var aPrices_local=convQuotes(trimStr(stripNewLineChars(e.value)));  
  if (aCreate=="2") aPrices_local="";            
  e=document.getElementById("adminElement_GloPrices");	  
  var aPrices_global=convQuotes(trimStr(stripNewLineChars(e.value)));
  if (aCreate=="2") aPrices_lobal="";            

  jsrsExecute("scripts/fx_SaveTour.php", adminOpr_cb, "do_SaveTour", 
   Array(aCreate,aTourID,aTourIdfier,aDisabled,aOfferable,aListable,aLang,aTitle,aGroup,aCatID,aLocID,aCaption,aName,aNotice,aArticle,aImpression,aLoc_local,aLoc_global,aMap_local,aMap_global,aDoc_local,aDoc_global,aDates_local,aDates_global,aPrices_local,aPrices_global));    		  	
}



function adminOpr_DeleteTour () {
  var e;	
  if (confirm("This language version of the tour will be erased permanently.\n\nAre you sure you want to continue ?")) {	
    e=document.getElementById("adminElement_id");	  
	var aTourID=stripHTML(convQuotes(trimStr(stripNewLineChars(e.value))));  
    e=document.getElementById("adminElement_language");	  	  
    var aLang=stripHTML(convQuotes(trimStr(stripNewLineChars(e.value))));  	
	if (confirm("Do you also want to erase other language versions and the tour itself completely ?")) aLang="";
    jsrsExecute("scripts/fx_DeleteTour.php", adminOpr_cb, "do_DeleteTour", Array(aTourID,aLang));    		  	
  }
}


function adminOpr_cb (returnString) {
  var errchk = returnString.substr(0,9);
  if (errchk == "errPoint:") {
	alert(returnString); 
  }
  else if (returnString!="") {
    var vals=returnString.split("|");	  
    goto_TourID = vals[0];
    goto_Lang = vals[1];
	if (vals.length>2) alert("A new tour has been created but directory creation failed for directory '"+vals[0]+"' under 'pics' directory, with the error shown below.\n\nThis will cause an error message while loading its tour page and prevent the tour pictures to be displayed. Please create an empty directory as '/pics/"+vals[0]+"' manually.\n\n"+vals[2]);
	window.setTimeout('goto_TourPage()',100);
  }
}



function admin_EditPictures (e) {
  if (e.value=="open pic.s") {	
    e.value="close pic.s";	
    w_picsPanel = showPopup(":: pictures","cockpit/admin_panel_pictures.php?TO="+xTourID,1,true,10,10,220,500,false);  
  }
  else if (e.value=="close pic.s") {
    e.value="open pic.s";	
    if (w_picsPanel) w_picsPanel.close();
  }
  else if (e.value=="refresh") {  
    document.location.reload(true);  
  }
}

