//display.write('<script type="text/javascript" src="\/CPv2_Main\/JSBalloon\/JSBalloon.js">');
//display.write('<\/script>\n');

var CPv2_Main = "EK/Main"
var timer;
var timer2;
var timer3;
var SearchTimer;
var timerStats;

function OpenHelp(theurl)
{
	newwindow = window.open(theurl,"helpwindow","status=1, status=1, width=450, height=450"); 
	newwindow.focus();
}

function MoveTo(urlname)
{
//alert(urlname);
	document.getElementById("loading").style.visibility="visible";
document.location = urlname;
	}

function Loading(onoff)
{
  if(onoff)
  {
    //xmlhttp.abort();
		document.getElementById("loading").style.visibility="visible";
  }
  else
  {
    document.getElementById("loading").style.visibility="hidden";
  }
}

/*********************************************************************
 Map Functions
*********************************************************************/



/* End Map Functions*************************************************/


/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function noenter() {
  if(window.event.keyCode == 13) 
  {
    window.event.keyCode = 0;
    GetResults();
  }
  return !(window.event && window.event.keyCode == 13); }

function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) 
		{
		keyCode = null;
		GetResults();
		} 
	}  
	
/*********************************************************************
      
   Link the library into your page with the following tag
   set in the HEAD portion of your document:
   
   <script language="javascript" src=../Include/cp.js></script>

      
***********************************************************************/

var newWindow = null;

	document.onclick=
function() {
	if(newWindow && !newWindow.closed){
   			 newWindow.close();}
}

function openWindow(theURL,winName,features) { 
	if(newWindow && !newWindow.closed){
	 newWindow.close();}
		newWindow=window.open(theURL,winName,features);
}

function closeWindow() 
{
	if(newWindow && !newWindow.closed)
		newWindow.close(); 
}

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function InitPointer()
{
//	alert("pre");
//	if(!document.getElementById("dhtmltooltip"))
	{
		//alert('In First If');
		//document.write('<img id="dhtmlpointer" src="/'+CPv2_Main+'/Images/arrow2.gif">'); //write out pointer image
		//document.write('<div id="dhtmltooltip"></div>'); //write out tooltip DIV
	}
}

//if(!TipWritten)
//{
//	var TipWritten = false;
//}

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

InitPointer();
	
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
//if (tipobj == 'undefined')
//{
//document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
//document.write('<img id="dhtmlpointer" src="/CPv2_Main/Images/arrow2.gif">') //write out pointer image
//var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "";
//}

if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip


/* Open Stills for Distribution */
function SelectStills(TourID, DistributionID)
{
	openWindow("SelectScenes.aspx?ID="+TourID+"&DistributionID="+DistributionID+"","DistSelector","width=480,height=435,toolbar=no,scrollbars=no,resizable=no,status=no,copyhistory=0");
}

/* Select Stills for Distribution */
function UpdateImageList(SceneID)
{
	alert(SceneID);	
}

function EditWebmaster(WebMastersEmail)
{
	var temp = "&nbsp;at <input type=\"text\" name=\"webmaster\" onKeyUp=\"CheckEmail();\" value=\""+WebMastersEmail+"\">";
	document.getElementById("EditWebmaster").innerHTML = temp;
}

function ChangePage(selObj){ //v3.0
  var targ=(selObj.options[selObj.selectedIndex].value);
  FetchURL('TourList.aspx?Page=' + targ+'','TourList');
  ChangeDivInner('Loading page '+targ+', please wait...','PagingControl');

//  alert(cont.options[cont.selectedIndex].value);
}

//Code for Manage Website
function AddLink()
{
  var URL = URLEncode(document.getElementById("URL").value);
  var Caption = URLEncode(document.getElementById("Caption").value);
  var OID = URLEncode(document.getElementById("OID").value);
  FetchURL('LinkList.aspx?URL=' + URL + '&Caption=' + Caption + '&OID=' + OID, 'LinkList');
  ChangeDivInner('Saving, please wait...','LinkList');
}

function EditLink(Caption,URL,OID)
{
  document.getElementById("URL").value = URLDecode(URL);
  document.getElementById("Caption").value = URLDecode(Caption);
  document.getElementById("OID").value = URLDecode(OID);
  document.getElementById("Add").value = "Save";
  document.getElementById("Lbl").innerHTML = "<b>Edit Link:</b> (<a href=\"javascript:FetchURL('LinkList.aspx', 'LinkList');\">Cancel</a>)";
}

// ====================================================================
//       URLEncode and URLDecode functions
//
// Copyright Albion Research Ltd. 2002
// http://www.albionresearch.com/
//
// You may copy these functions providing that 
// (a) you leave this copyright notice intact, and 
// (b) if you use these functions on a publicly accessible
//     web site you include a credit somewhere on the web site 
//     with a link back to http://www.albionresarch.com/
//
// If you find or fix any bugs, please let us know at albionresearch.com
//
// SpecialThanks to Neelesh Thakur for being the first to
// report a bug in URLDecode() - now fixed 2003-02-19.
// ====================================================================
function URLEncode(plaintext)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	//var plaintext = document.URLForm.F1.value;
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	return encoded;
};

function URLDecode(encoded)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
   //var encoded = document.URLForm.F2.value;
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2) 
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   //document.URLForm.F1.value = plaintext;
   return plaintext;
};


function ChangeDivInner(NewData,Control)
{
  try
  {
  document.getElementById(Control).innerHTML = NewData;
  }
  catch (e)
	{
		//document.getElementById(Target).value = xmlhttp.responseText;
	}
}

function GetDistributionStatus(DistributionQueueIDs)
{
	//document.getElementById([DistributionQueueID]).innerHTML = 'Test '+DistributionQueueID;
	//FetchURL('DistributionList.aspx?DistributionQueueID='+DistributionQueueID,DistributionQueueID,3000);
	
	var URL = 'DistributionList.aspx?DistributionQueueIDs='+DistributionQueueIDs;

	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}


	xmlhttp.open("GET", URL, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
				//document.getElementById("").innerHTML = xmlhttp.responseText;
//				var response = xmlhttp.responseXML.documentElement;

//var x = xmlhttp.responseXML.documentElement.getElementsByTagName('ID31386');
//alert(x);
ParseToIds(xmlhttp.responseText,DistributionQueueIDs);
				//alert(xmlhttp.getElementsByTagName('ID31386')[0].firstChild.nodeValue);
//				document.getElementById('33782').innerHTML = xmlhttp.responseText.getElementById('ID33782').innerHtml;
//var i, n_elems, elems = xmlhttp.getElementsByTagName("ID31386");
//n_elems = elems.length;
//for (i = 0; i < n_elems; i++) 
//alert(elems[i].firstChild.nodeValue + "<br>");


		}
	}
	xmlhttp.send(null)
	 
	 
 //StartTimer for 5 sec refresh
 clearTimeout(timer3);
 clearTimeout(timer2);
 timer2 = setTimeout('GetDistributionStatus(\''+DistributionQueueIDs+'\')', 30000);
}


function ParseToIds(XML,DistributionQueueIDs)
{
if(DistributionQueueIDs != "")
	{
	var ar = XML.split('|');
	for (i = 0; i < ar.length-1; i++)
	{
		var pr = ar[i].split('~');
		document.getElementById(pr[0]).innerHTML = pr[1];
	}
	clearTimeout(timer3);
	timer3 = setTimeout('GetDistributionStatus(\''+DistributionQueueIDs+'\')', 5000);
	//var alert(XML.substring(sPos,ePos));
	
	}
}

function ResetDistribution(DistributionQueueID,TourID)
{
	document.getElementById('Btn'+DistributionQueueID).innerHTML = 'Resetting';
	FetchURL('ResetDistribution.aspx?ID='+TourID+'&DistID='+DistributionQueueID,'Btn'+DistributionQueueID,0, 'Reset')
}

function FetchURL(URL,Target)
{
	FetchURL(URL,Target,0,'');
}

function FetchURL(URL,Target,RetryInterval)
{
	FetchURL(URL,Target,RetryInterval,'');
}

var cEndMessage = '';

function FetchURL(URL,Target,RetryInterval,EndMessage)
{
document.body.style.cursor='wait';
//if(!EndMessage)
//{
//	EndMessage = '';
//}

//alert(EndMessage);
//alert(URL);
//  document.getElementById(Target).innerHTML = "Loading..."; 
 
cEndMessage = EndMessage; 

 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

  //AddUnique Key to Querystring
  if(URL.indexOf("?") > -1)
  {
    URL += "&uKey="+new Date();
  }
  else
  {
    URL += "?uKey="+new Date();
  }

	xmlhttp.open("GET", URL, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
		//alert(Target);
			if(!EndMessage)
			{
				try
				{
				  document.getElementById(Target).innerHTML = xmlhttp.responseText;
				}
				catch (e)
				{
				  try
				  {
				    document.getElementById(Target).src = xmlhttp.responseText;
				  }
				  catch (e)
				  {
  				  document.getElementById(Target).value = xmlhttp.responseText;
				  }
				}
			}
			else
			{
				document.getElementById(Target).innerHTML = EndMessage;
			} 
			
			document.body.style.cursor='auto';
		}
	}
	xmlhttp.send(null)
	 
	 
 //StartTimer for 60 sec refresh
 if(RetryInterval > 0)
 {
 //alert("FetchURL("+URL+","+Target+","+RetryInterval+")");
   clearTimeout(timer);
	 timer = setTimeout("FetchURL(\""+URL+"\",\""+Target+"\","+RetryInterval+","+EndMessage+")", RetryInterval);
 }
}

function PostForm(URL, Target)
{
document.body.style.cursor='wait';
 
//Get Form Fields that start with x
parameters = '';
//var formElements = document.getElementsByTagName('Form1');
//alert(formElements.length);
var x = document.forms[0].elements
for (var i = 0; i < x.length; i++) {
if (x[i].className.match(/\bajax\b/)) {
  if(parameters == '')
    parameters = x[i].name + '=' +x[i].value;       
  else
    parameters += '&' + x[i].name + '=' +x[i].value;       

}
}

//alert(parameters);
 
//Start Send

 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

  //AddUnique Key to Querystring
  if(URL.indexOf("?") > -1)
    URL += "&uKey="+new Date();
  else
    URL += "?uKey="+new Date();

    xmlhttp.open('POST', URL, true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.setRequestHeader("Content-length", parameters.length);
    xmlhttp.setRequestHeader("Connection", "close");

	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
		//alert(Target);
				try
				{
				  document.getElementById(Target).innerHTML = xmlhttp.responseText;
				}
				catch (e)
				{
 				  document.getElementById(Target).value = xmlhttp.responseText;
				}
			
			document.body.style.cursor='auto';
		}
	}
	//alert(parameters);
  xmlhttp.send(parameters);
}

function Fetch2(URL,Target,Target2)
{
  Fetch2(URL,Target,Target2, '', '')
}
function Fetch2(URL,Target,Target2,Target3)
{
  Fetch2(URL,Target,Target2, Target3, '')
}
function Fetch2(URL,Target,Target2,Target3,Target4)
{
//cEndMessage = EndMessage; 

 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

  //AddUnique Key to Querystring
  if(URL.indexOf("?") > -1)
  {
    URL += "&uKey="+new Date();
  }
  else
  {
    URL += "?uKey="+new Date();
  }

	xmlhttp.open("GET", URL, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(Target);
		//alert(Target2);
		var ar = xmlhttp.responseText.split('|');
    //		      if(ar[0] != "")
		
		  //Msg 1
		  if(ar[0] != "")
		  {
			  try
			  {
  		  document.getElementById(Target).style.visibility = "visible";
			  document.getElementById(Target).style.position = "relative";
				  document.getElementById(Target).innerHTML = ar[0];
			  }
			  catch (e)
			  {
				  try
				  {
				    document.getElementById(Target).src = ar[0];
				  }
				  catch (e)
				  {
  				  document.getElementById(Target).value = ar[0];
				  }
			  }
      }
      else
			{
			  document.getElementById(Target).style.visibility = "hidden";
			  document.getElementById(Target).style.position = "absolute";
			  document.getElementById(Target).innerHTML = "";
			}
      
      //Msg 2
			if((ar[1] != null) && (ar[1] != ""))
			{
			//alert(ar[1]);
			  try
			  {
			  document.getElementById(Target2).style.visibility = "visible";
			  document.getElementById(Target2).style.position = "relative";
				  document.getElementById(Target2).innerHTML = ar[1];
			  }
			  catch (e)
			  {
				  try
				  {
				    document.getElementById(Target2).src = ar[1];
				  }
				  catch (e)
				  {
  				  document.getElementById(Target2).value = ar[1];
				  }
			  }
			}
			else
			{
			  try {
			    document.getElementById(Target2).style.visibility = "hidden";
			    document.getElementById(Target2).style.position = "absolute";
			    document.getElementById(Target2).innerHTML = "";
			  } catch (e) {}
			}
			
			      //Msg 3
			if((ar[2] != null) && (ar[2] != ""))//(ar[2] != "")
			{
			//alert(ar[2]);
			  try
			  {
			  document.getElementById(Target3).style.visibility = "visible";
			  document.getElementById(Target3).style.position = "relative";
				  document.getElementById(Target3).innerHTML = ar[2];
			  }
			  catch (e)
			  {
				  try
				  {
				    document.getElementById(Target3).src = ar[2];
				  }
				  catch (e)
				  {
  				  document.getElementById(Target3).value = ar[2];
				  }
			  }
			}
			else
			{
			  try {
			    document.getElementById(Target3).style.visibility = "hidden";
			    document.getElementById(Target3).style.position = "absolute";
			    document.getElementById(Target3).innerHTML = "";
			  } catch (e) {}
			}
			
			      //Msg 4
			if((ar[3] != null) && (ar[3] != ""))//(ar[3] != "")
			{
			//alert(ar[1]);
			  try
			  {
			  document.getElementById(Target4).style.visibility = "visible";
			  document.getElementById(Target4).style.position = "relative";
				  document.getElementById(Target4).innerHTML = ar[3];
			  }
			  catch (e)
			  {
				  try
				  {
				    document.getElementById(Target4).src = ar[3];
				  }
				  catch (e)
				  {
  				  document.getElementById(Target4).value = ar[3];
				  }
			  }
			}
			else
			{
			  try {
			    document.getElementById(Target4).style.visibility = "hidden";
			    document.getElementById(Target4).style.position = "absolute";
			    document.getElementById(Target4).innerHTML = "";
			  } catch (e) {}
			}
			
			//if id=MapViewer is on the page, call InitMap();
      if(document.getElementById('MapViewer') != null)
        InitMap();

		}
	}
	xmlhttp.send(null)
}

function ChangeTrx(URL, Target)
{
  //document.getElementById(Target).src = "fsd";
  FetchURL(URL, Target);
}

function FetchSystemStats()
{
  FetchSystemStats('','');
}

function RemoveFromQueue(GUID)
{
	clearTimeout(timer);
	FetchURL("ssRemoveFromQueue.aspx?GUID="+GUID,"RemoveFromQueue");
}

function FetchSystemStats(id,mode)
{
clearTimeout(timerStats);
//if(!EndMessage)
//{
//	EndMessage = '';
//}

//alert(EndMessage);
//alert(Target);
//  document.getElementById(Target).innerHTML = "Loading..."; 
 
//cEndMessage = EndMessage; 

 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

  var u = "StatusList.aspx?i="+id+"&m="+mode;
  //alert(u);
	xmlhttp.open("GET", u , true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
		//alert(Target);

      document.getElementById("Summary").innerHTML = xmlhttp.responseText;

//				try
//				{
//				  //Split into 6
//				  var ar = xmlhttp.responseText.split('|');
//		      if(ar[0] != "")
//		      {
//		        document.getElementById("msg0").innerHTML = ar[0];
//		        document.getElementById("msg0").style.backgroundColor  = "lightyellow";
//		      }
//		      else
//		      {
// 		        document.getElementById("msg0").style.backgroundColor  = "white";
//		      }
		      
//		      if(ar[1] != "")
//		      {
//		        document.getElementById("msg1").innerHTML = ar[1];
//		        document.getElementById("msg1").style.backgroundColor  = "lightyellow";
//		      }
//		      else
//		      {
// 		        document.getElementById("msg1").style.backgroundColor  = "white";
//		      }
		      
//		      if(ar[2] != "")
//		      {
//		        document.getElementById("msg2").innerHTML = ar[2];
//		        document.getElementById("msg2").style.backgroundColor  = "lightyellow";
//		      }
//		      else
//		      {
// 		        document.getElementById("msg2").style.backgroundColor  = "white";
//		      }
		      
//		      if(ar[3] != "")
//		      {
//		        document.getElementById("msg3").innerHTML = ar[3];
//		        document.getElementById("msg3").style.backgroundColor  = "lightyellow";
//		      }
//		      else
//		      {
// 		        document.getElementById("msg3").style.backgroundColor  = "white";
//		      }
		      
//		      if(ar[4] != "")
//		      {
//		        document.getElementById("msg4").innerHTML = ar[4];
//		        document.getElementById("msg4").style.backgroundColor  = "lightyellow";
//		      }
//		      else
//		      {
// 		        document.getElementById("msg4").style.backgroundColor  = "white";
//		      }
		      
//		      if(ar[5] != "")
//		      {
//		        document.getElementById("msg5").innerHTML = ar[5];
//		        document.getElementById("msg5").style.backgroundColor  = "lightyellow";
//		      }
//		      else
//		      {
// 		        document.getElementById("msg5").style.backgroundColor  = "white";
//		      }
//				}
//				catch (e)
//				{
//				}
		}
	}
	xmlhttp.send(null)
	 
  //StartTimer for 10 sec refresh
  if(id == '')
    timerStats = setTimeout("FetchSystemStats('"+id+"','"+mode+"')", 10000);
  else
    timerStats = setTimeout("FetchSystemStats('"+id+"','"+mode+"')", 10000);
}

function FetchTourList(URL)
{
//if(!EndMessage)
//{
//	EndMessage = '';
//}

//alert(EndMessage);
//alert(URL);
//  document.getElementById(Target).innerHTML = "Loading..."; 
 
//cEndMessage = EndMessage; 

 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
  t = new Date();
  if(URL.indexOf("?") > -1)
    URL = URL + "&ukey="+t;
  else
    URL = URL + "?ukey="+t;
//alert(URL);
	xmlhttp.open("GET", URL, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
		//alert(Target);

				try
				{
				  //Split into 6
				  var ar = xmlhttp.responseText.split('|');
		      if(ar[0] != "")
		      {
		        document.getElementById("CurrentDate").innerHTML = '<span style="font-weight:bold;">'+ar[0]+'</span>';
          }		      
		      if(ar[1] != "")
		      {
		        document.getElementById("TourResults").innerHTML = ar[1];
          }		      

				}
				catch (e)
				{
    		}

		}
	}
	xmlhttp.send(null)
	 
	 
 //StartTimer for 60 sec refresh
// if(RetryInterval > 0)
// {
 //alert("FetchURL("+URL+","+Target+","+RetryInterval+")");
//   clearTimeout(timer);
//	 timer = setTimeout("FetchURL(\""+URL+"\",\""+Target+"\","+RetryInterval+","+EndMessage+")", RetryInterval);
// }
}



function GoTo(url)
{
	parent.location = url;
}

function ChangeClass(Target,cName)
{
//alert(Target);
try {
	document.getElementById(Target).className = cName;
	} catch (e){}
}

//** Code For Order Page *******************************************

function getSelectedScenes(boxgroup)
			{
				changeSelected('cbSelectStills')
		
			var len = boxgroup.length;
			var numOfScenes = 0;
			var message = document.getElementById('Extra');
				
			var ExtraScenes = 0.00;
			var ExtraSceneTotal = 0.00;
						
			for (var i = 0; i <len; i++)
				{
				var elem = document.getElementById('cblPhotos_'+[i]);
			
					if (elem.checked)
					{
					numOfScenes++;	
					if(numOfScenes > MaxScenes)
					{
					ExtraScenes=numOfScenes - MaxScenes;
					
					ExtraSceneTotal=ExtraScenes*ExtraCost;
					var s = ""+ExtraSceneTotal;
					var pos=s.indexOf(".")
								if (pos<0)
									{				
									ExtraSceneTotal= ExtraSceneTotal += '.00'
									}
					}
					if(ExtraSceneTotal > 0 )
					{
						message.innerHTML="&nbsp; * Extra Scene Charge: "+ExtraScenes +" Scene x "+ExtraCost+" = $"+ExtraSceneTotal;
					}
					else
					{
						message.innerHTML="&nbsp;";
					}
					
				}	
			}
		}
		function removeSelectedScenes(boxgroup)
			{		
			var message = document.getElementById('Extra');

			var len =boxgroup.length;
				for (var i = 0; i <len; i++)
					{
					var elem = document.getElementById('cblPhotos_'+[i]);
					if (elem.checked)
					{
						elem.checked = false;
					}
				message.innerHTML="";	
				}	
			}
				
	function changeSelected(elemId)
	{
		var elem = document.getElementById(elemId);
	
		if (elem.checked)
			{
			elem.checked = false;
			
		}
	}
	
function removeDateTime()
		{
			
			var elem =document.getElementById('ddlTime');
				
				 elem.options[0].selected=true;
		
		var dte = document.getElementById('txtDate');
			
				dte.value=PreferredDate;
			
		}
				
function showFrame()
		{
		document.getElementById("popFrame").style.visibility="visible";
		}

function hideFrame()
		{
		
		document.getElementById("popFrame").style.visibility="hidden";
		
		}
		
		function GetOpts(Page)
		{
		  var cb = "";
      cb += "Columns: ";
      cb += "<select name=\'Col\' id=\'Col\'>";
      cb += "<option value=\'2\'>2</option>";
      cb += "<option value=\'3\'>3</option>";
      cb += "</select>";
      cb += " Rows: ";
      cb += "<select name=\'Row\' id=\'Row\'>";
      cb += "<option value=\'4\'>4</option>";
      cb += "<option value=\'5\'>5</option>";
      cb += "<option value=\'6\'>6</option>";
      cb += "<option value=\'7\'>7</option>";
      cb += "<option value=\'8\'>8</option>";
      cb += "</select> ";
      cb += "<input type=\'button\' name=\'Save\' value=\'Save\' onclick=\'SendOpts("+Page+");\'>";

      document.getElementById('tright').innerHTML= cb;
		}
		function SendOpts(Page)
		{
		  var url = 'TourList.aspx?Page='+Page+'&C='+document.getElementById("Col").value + '&R='+document.getElementById("Row").value;
	//alert(url);
		  FetchURL(url,'TourList');
		  ChangeDivInner("Loading page "+Page+", please wait...","PagingControl");
}

function FetchFrame(Title,URL)
{
  clearTimeout(timer);
  //clearTimeout(timer2)
  //clearTimeout(timer3)
  t = '<div class="DashBoardItemTitle">'+Title+'</div>';
  t += '<iframe width=500 height=500 src="'+URL+'" frameborder="0"></iframe>';

  document.getElementById('Details').innerHTML = t;
}

function DivVisible(divname)
{
//alert(divname);
  if(document.getElementById(divname).style.visibility == "visible")
  {
    document.getElementById(divname).style.visibility="hidden";
    document.getElementById(divname).style.height="0";
  }
  else
  {
    document.getElementById(divname).style.visibility="visible";
    document.getElementById(divname).style.height="auto";
  }
}

	function setDate()
	{
	var dte = parent.document.getElementById('txtDate');

		dte.value=sdate;
		
		
	parent.document.getElementById("popFrame").style.visibility="hidden";

	}
//** End of - Code For Order Page *******************************************
		 
		 
function entsub(myfo) {
  if (window.event && window.event.keyCode == 13)
    __doPostBack(myfo);
    //myform.submit();
  else
    return true;}
    
// ** Start - Account Search ************************************************** //
function GetResults()
{
  Loading(true);
  
  document.getElementById("sresults").className = 'SearchResults';
	var sc = document.getElementById("tbSearchCriteria").value;
	
	msg = '<table width="100%"><tr><td>';
	msg += '<b>Searching for \''+sc+'\'...</b>';
	msg += '</td><td align="right">';
	msg += '<a href="#" onclick="SearchOff()">Close</a>';
	msg += '</td></td></table>';
	
  document.getElementById("sresults").innerHTML = msg;
  document.getElementById('sresults').focus();

  clearTimeout(SearchTimer);
  var fn = 'FetchURLCheck(\'/'+CPv2_Main+'/Search/AccountSearchResults.aspx?SC='+sc+'\',\'sresults\',0,\'\')';
  //alert(fn);
  
 
  SearchTimer = setTimeout(fn, 10);
  
	//FetchURL('AccountSearchResults.aspx?SC='+sc,'results',0,'');
}

function SearchOff()
{
  document.getElementById('tbSearchCriteria').focus();
  document.getElementById('sresults').innerHtml = '';
  document.getElementById('sresults').className='SearchResultsOff';
  
}

function SearchRecent(sc)
{
  document.getElementById('loading').style.visibility = 'visible';

  document.getElementById("sresults").className = 'SearchResults';
	
	document.getElementById("tbSearchCriteria").value = sc;
	
	msg = '<table width="100%"><tr><td>';
	msg += 'Searching for \''+sc+'\'...';
	msg += '</td><td align="right">';
	msg += '<a href="#" onclick="SearchOff()">Close</a>';
	msg += '</td></td></table>';
	
  document.getElementById("sresults").innerHTML = msg;
  document.getElementById('sresults').focus();

  clearTimeout(SearchTimer);
  var fn = 'FetchURLCheck(\'/'+CPv2_Main+'/Search/AccountSearchResults.aspx?SC='+sc+'\',\'sresults\',0,\'\')';
  //alert(fn);
  
 
  SearchTimer = setTimeout(fn, 10);
}

function FetchURLCheck(URL,Target,RetryInterval,EndMessage)
{
//if(!EndMessage)
//{
//	EndMessage = '';
//}

//alert(EndMessage);
//alert(Target);
//  document.getElementById(Target).innerHTML = "Loading..."; 
 
cEndMessage = EndMessage; 

 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

//alert(URL);
	xmlhttp.open("GET", URL, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
    var the_string = xmlhttp.responseText;
    
    //alert(the_string);
    
    var to = the_string.length;
    var from = the_string.indexOf("|");

    var RecentSearches = the_string.substring(0, from);
    if(RecentSearches != '')
      document.getElementById('RecentSearches').innerHTML = "Recent: "+ RecentSearches;

    the_string = the_string.substring(from +1, to);
    from = the_string.indexOf("|");
    var first_string = the_string.substring(0, from);
    var the_substring = the_string.substring(from +1, to);
    var re = Trim(document.getElementById("tbSearchCriteria").value);
//    alert('"'+re+'"');
    //if(re == first_string)
    {
    //alert(the_substring);
		  document.getElementById(Target).innerHTML = the_substring;
		}
		Loading(false);
		}
	}
	xmlhttp.send(null)
}

function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function


function GoToTour(url)
{
	window.location.href = url;
	//window.close();
}

function GoToOrder(url)
{
//alert(url);
	window.location.href = url;
	//window.close();
}

// ** End - Account Search **************************************************** //

//**Start of Website Javascript *****//
function ChangeTemplate(y,z)
	{
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
			theform = document.forms["Form1"];
		}
		else {
			theform = document.Form1;
		}
			
		//alert(y);
		//var x = getElementById(theform.txtCurrent_TemplateID);
		theform.txtCurrent_TemplateCaption.value = y;	
		theform.txtCurrent_TemplateID.value = z;	
		
		
		//alert('Text: '+theform.txtCurrent_TemplateID.value);
	}
	function ChangeBanner(y)
	{
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
			theform = document.forms["Form1"];
		}
		else {
			theform = document.Form1;
		}
		theform.txtCurrent_BannerCaption.value = y;	
	}
	function ChangeStyle(y)
	{
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
			theform = document.forms["Form1"];
		}
		else {
			theform = document.Form1;
		}
		theform.txtCurrent_Style.value = y;	
	}
	function ChangeLogo(y)
	{
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
			theform = document.forms["Form1"];
		}
		else {
			theform = document.Form1;
		}
		theform.txtCurrent_CompanyLogo.value = y;	
	}


function FetchPublicInfo()
{
//if(!EndMessage)
//{
//	EndMessage = '';
//}

//alert(EndMessage);
//alert(Target);
//  document.getElementById(Target).innerHTML = "Loading..."; 
 
 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}


	xmlhttp.open("GET", "MyProfilePrivateFetch.aspx", true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
    var the_string = xmlhttp.responseText;
    
    //alert(the_string);
    var ar = the_string.split('|');
    document.getElementById("tbName").value = ar[0];
    document.getElementById("tbCompany").value = ar[1];
    document.getElementById("tbPhone").value = ar[2];
    document.getElementById("tbEmail").value = ar[3];
    }
	}
	xmlhttp.send(null)
}

function FetchPublicInfo(AccountID)
{
//if(!EndMessage)
//{
//	EndMessage = '';
//}

//alert(EndMessage);
//alert(Target);
//  document.getElementById(Target).innerHTML = "Loading..."; 
 
 var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

//alert(AccountID);
	xmlhttp.open("GET", "MyProfilePrivateFetch.aspx?AccountID="+AccountID, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		//alert(xmlhttp.responseText);
		//alert(EndMessage);
    var the_string = xmlhttp.responseText;
    
    //alert(the_string);
    var ar = the_string.split('|');
    document.getElementById("tbName").value = ar[0];
    document.getElementById("tbCompany").value = ar[1];
    document.getElementById("tbPhone").value = ar[2];
    document.getElementById("tbEmail").value = ar[3];
    }
	}
	xmlhttp.send(null)
}

function SavePublic(AccountID)
{
  q = 'Name='+URLEncode(document.getElementById("tbName").value);
  q += '&Company='+URLEncode(document.getElementById("tbCompany").value);
  q += '&Phone='+URLEncode(document.getElementById("tbPhone").value);
  q += '&Email='+URLEncode(document.getElementById("tbEmail").value);

//alert(q);
  FetchURL('UpgradeAccountSteps.aspx?AccountID='+AccountID+'&'+q, 'Upgrade');
}


//Tab Code from DynamicDrive.com

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadstatustext="<img src='images/loading.gif' /> Requesting content..."

////NO NEED TO EDIT BELOW////////////////////////
var loadedobjects=""
var defaultcontentarray=new Object()
var bustcacheparameter=""

function ajaxpage(url, containerid, targetobj){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
var ullist=targetobj.parentNode.parentNode.getElementsByTagName("li")
for (var i=0; i<ullist.length; i++)
ullist[i].className=""  //deselect all tabs
targetobj.parentNode.className="selected"  //highlight currently clicked on tab
if (url.indexOf("#default")!=-1){ //if simply show default content within container (verus fetch it via ajax)
document.getElementById(containerid).innerHTML=defaultcontentarray[containerid]
return
}
document.getElementById(containerid).innerHTML=loadstatustext
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(revattribute){
if (revattribute!=null && revattribute!=""){ //if "rev" attribute is defined (load external .js or .css files)
var objectlist=revattribute.split(/\s*,\s*/) //split the files and store as array
for (var i=0; i<objectlist.length; i++){
var file=objectlist[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
}

function expandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel")){
ajaxpage(thetab.getAttribute("href"), thetab.getAttribute("rel"), thetab)
loadobjs(thetab.getAttribute("rev"))
}
}

function savedefaultcontent(contentid){// save default ajax tab content
if (typeof defaultcontentarray[contentid]=="undefined") //if default content hasn't already been saved
defaultcontentarray[contentid]=document.getElementById(contentid).innerHTML
}

function startajaxtabs(){
for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
for (var x=0; x<ulist.length; x++){ //loop through each LI element
var ulistlink=ulist[x].getElementsByTagName("a")[0]
if (ulistlink.getAttribute("rel")){
var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
ulistlink.setAttribute("href", modifiedurl) //replace URL's root domain with dynamic root domain, for ajax security sake
savedefaultcontent(ulistlink.getAttribute("rel")) //save default ajax tab content
ulistlink.onclick=function(){
ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
loadobjs(this.getAttribute("rev"))
return false
}
if (ulist[x].className=="selected"){
ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink) //auto load currenly selected tab content
loadobjs(ulistlink.getAttribute("rev")) //auto load any accompanying .js and .css files
}
}
}
}
}

function ChangeTabClass(tabon, v1,v2)
{
  ChangeClass('still1','shadetabs');
  ChangeClass('still2','shadetabs');
  ChangeClass('pano1','shadetabs');
  ChangeClass('pano2','shadetabs');
  ChangeClass('strip1','shadetabs');
  ChangeClass('strip2','shadetabs');
  ChangeClass('wma1','shadetabs');
  ChangeClass('wma2','shadetabs');
  ChangeClass('mov1','shadetabs');
  ChangeClass('mov2','shadetabs');

  ChangeClass('desc','');
  ChangeClass('still1','');
  ChangeClass('still2','');
  ChangeClass('pano1','');
  ChangeClass('pano2','');
  ChangeClass('strip1','');
  ChangeClass('strip2','');
  ChangeClass('wma1','');
  ChangeClass('wma2','');
  ChangeClass('mov1','');
  ChangeClass('mov2','');

  ChangeClass(tabon,'selected');
  
  Fetch2(v1, v2);

}