var activeexpander;
var globaldynhtml;
var toggleShow = false;
var multilinetext = false;

hs.graphicsDir = 'http://www.cplanet.com/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.showCredits = false;

hs.skin.contentWrapper =
	'<div class="highslide-header">'+
	'</div>'+
	'<div class="highslide-body"></div>'+
	'<div class="highslide-footer">'+
		'<table width="100%"><tr><td align="left"><a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)"><span>{hs.lang.closeText}</span></a></td>'+
		'<td align="right"><span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span></td></tr></table>'+
	'</div></div>';

hs.Expander.prototype.onBeforeClose = function() { 
	multilinetext = false;
	document.body.focus(); 
}

hs.transitions = ['expand', 'crossfade'];

hs.moveText = '<img src="http://www.cplanet.com/highslide/graphics/move.gif" border="0" />';
hs.closeText = '<img src="http://www.cplanet.com/highslide/graphics/close.gif" border="0" />';

hs.onActivate = function() {
   var theForm = document.getElementById("form1");
   if (theForm) theForm.appendChild(hs.container);
}

hs.onDimmerClick = function() {
  return false;
}

//hs.Expander.prototype.onMouseOver = function () {
//  this.focus();
//  activeexpander=this;
//}

hs.Expander.prototype.onDrag = function (sender, e) {
//	var line = "";   
//	   //for (var x in e) line += x +": "+ e[x] +", ";
//	   //alert(e.type);
//	if(sender.thumb.title=='panocontent'){
//		if(e.type=='resize'){
//			resizepano();
//		}
//	}
}


hs.onKeyDown = function (sender, e) {
	var thisexpander = hs.getExpander();
	var expanderid=thisexpander.a.id;
	//alert(expanderid);
	switch (expanderid){
		case 'standardanchor':
			return false;
		break;
	}
		
}


function closeactiveexpander(){
	var thisexpander = hs.getExpander();
	thisexpander.close();
}
		
		
function highslidecontrol(panel){
	
	switch (panel){
		
		//OPEN SPECIFIC INLINE DIV
		case 'standard':
			//alert('editgroup');
			var imagetag=document.getElementById('destoptionsanchor');
			imagetag.onclick = function() {hs.htmlExpand(imagetag, { contentId:'destoptionspanel', width: 200, height: 325 } )};
			imagetag.onclick();
		break;
		
		case 'destgroup':
			//alert('editgroup');
			var imagetag=document.getElementById('destgroupanchor');
			imagetag.onclick = function() {hs.htmlExpand(imagetag, { contentId:'destgrouppanel', width: 200, height: 325 } )};
			imagetag.onclick();
		break;
		
	}
	
}


function opencontrol(control){
	
	//OPEN SPECIFIC IFAMED PAGE
	var contentform;
	var imagetag = document.getElementById('cpcontrolsanchor');
	var hswidth = '550';
	var hsheight = '300';
	var htitle = "";
	
		switch (control){
			
			case 'lostpassword':
				hswidth = '400';
				hsheight = '300';
				htitle = "Did you forget your Cplanet Password?"
				contentform='http://www.cplanet.com/controls/cplostpassword.aspx';
			break;
			
		}
		
		var hsheaderhtml = '<table><tr><td width="100%"><div class="cpfontheading" id="hscontroltitle">'+htitle+'</div></td><td align="right"><img src="http://www.cplanet.com/highslide/graphics/close.gif" onclick="closeactiveexpander()" alt="Close Panel" onmouseover="this.style.cursor=\'pointer\'" border="0" /></td></tr></table>';
			
		imagetag.href=contentform;
		imagetag.onclick = function() {return hs.htmlExpand(imagetag, { objectType: 'iframe', preserveContent: false, headingText: hsheaderhtml, align: 'center', dimmingOpacity: 0.75, width: hswidth, height: hsheight } )};
		imagetag.onclick();

}

function closehscontrols(){
	var imagetag=document.getElementById('cpcontrolslink');
	hs.close(imagetag);
}


function highslideajax(extpage, pagesection, hsanchor, htitle, hswidth, hsheight, dimmeron){
	
	//alert(extpage+' , '+pagesection+' , '+htitle+' , '+hswidth+' , '+hsheight+' , '+dimmeron)
	
	if(!hswidth){
		hswidth = '550';
	}
	
	if(!hsheight){
		hsheight = '450';
	}
	
	var ajaxlink = extpage
	
	if(pagesection){
		ajaxlink += '#'+pagesection;
	}
	
	var hsheaderhtml = '<table><tr><td width="100%"><div class="cpfontheading" id="ajaxtitle">'+htitle+'</div></td><td align="right"><img src="http://www.cplanet.com/highslide/graphics/close.gif" onclick="closeactiveexpander()" alt="Close Panel" onmouseover="this.style.cursor=\'pointer\'" border="0" /></td></tr></table>';
	
	if(!hsanchor){
		var imagetag = document.getElementById('ajaxanchor');
	}else{
		var imagetag = document.getElementById(hsanchor);
	}
	
	
	imagetag.href = ajaxlink;
	
	if(dimmeron == true){
		imagetag.onclick = function() {return hs.htmlExpand(imagetag, {  objectType: 'ajax', preserveContent: false, headingText: hsheaderhtml, align: 'center', width: hswidth, height: hsheight, dimmingOpacity: 0.75 } )};
	}else{
		imagetag.onclick = function() {return hs.htmlExpand(imagetag, {  objectType: 'ajax', preserveContent: false, headingText: hsheaderhtml, align: 'center', width: hswidth, height: hsheight } )};
	}
	
	imagetag.onclick();
	
}




function displayMessage(message, htitle, hswidth, hsheight) {
	
	if(!message){
		message = globaldynhtml;	
	}
	
	if(!htitle){
		htitle = '';
	}
	
	var hsheaderhtml = '<table><tr><td width="100%"><div class="cpfontheading" id="hscontroltitle">'+htitle+'</div></td><td align="right"><img src="http://www.cplanet.com/highslide/graphics/close.gif" onclick="closeactiveexpander()" alt="Close Panel" onmouseover="this.style.cursor=\'pointer\'" border="0" /></td></tr></table>';
	
	if(!hswidth){
		hs.htmlExpand(document.getElementById('messagelink'), { maincontentText: message, headingText: hsheaderhtml, align: 'center', preserveContent: false, allowMultipleInstances: true });
	}else{
		hs.htmlExpand(document.getElementById('messagelink'), { maincontentText: message, headingText: hsheaderhtml, align: 'center', preserveContent: false, allowMultipleInstances: true, width: hswidth, height: hsheight });
	}
		
}

function displayMessagewithDim(message, htitle, hswidth, hsheight) {
	
	if(!message){
		message = globaldynhtml;	
	}
	
	if(!htitle){
		htitle = '';
	}
	
	var hsheaderhtml = '<table><tr><td width="100%"><div class="cpfontheading" id="hscontroltitle">'+htitle+'</div></td><td align="right"></td></tr></table>';
	
	if(!hswidth){
		hs.htmlExpand(document.getElementById('messagelink'), { maincontentText: message, headingText: hsheaderhtml, align: 'center', preserveContent: false, allowMultipleInstances: true, dimmingOpacity: 0.75 });
	}else{
		hs.htmlExpand(document.getElementById('messagelink'), { maincontentText: message, headingText: hsheaderhtml, align: 'center', preserveContent: false, allowMultipleInstances: true, width: hswidth, height: hsheight, dimmingOpacity: 0.75 });
	}
		
}
