/* functions set banner  interval */
 var c;

 /*function timedCount()
 {
 	 if(parseInt(Get_Cookie('currenttimecounter'+sessID),10)) {
         c = parseInt(Get_Cookie('currenttimecounter'+sessID),10); 
	 } else {
	 	c = 0;
	 }
	 c=parseInt(c,10)+1;       
	 if(c==parseInt(Get_Cookie('mybannerduration'+sessID),10)) {
	       c=0;    
	 }
	 if(c < 0) {
	   c = 0;
	 }
	 if(document.getElementById('counter')) {
	   	 document.getElementById('counter').value = parseInt(c,10);   
  	 }
	 Delete_Cookie('currenttimecounter'+sessID,'/'); 
	 Set_Cookie('currenttimecounter'+sessID,parseInt(c,10),30,"/", "","");
	 setTimeout("timedCount()",1000);
} */
function timedCount()
 {
 	 if(parseInt(Get_Cookie('currenttimecounter'+sessID),10)) {
         c = parseInt(Get_Cookie('currenttimecounter'+sessID),10); 
	 } else {
	 	c = 0;
	 }
	 c=parseInt(c,10)+1;       
	 if(c==parseInt(Get_Cookie('mybannerduration'+sessID),10)) {
	       c=0;    
	 }
	 if(c < 0) {
	   c = 0;
	 }
	 if(document.getElementById('counter')) {
	   	 document.getElementById('counter').innerHTML = intduration - parseInt(c,10);   
  	 }
	 Delete_Cookie('currenttimecounter'+sessID,'/'); 
	 Set_Cookie('currenttimecounter'+sessID,parseInt(c,10),30,"/", "","");
	 setTimeout("timedCount()",1000);
}

/////////////////////////////////
// File Name: mBanner.js       //
// By: Manish Kumar Namdeo     //
/////////////////////////////////

//Set cookies for next banner to display
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}
// this function gets the cookie, if it exists
function Get_Cookie( name )
{
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) &&
	( name != document.cookie.substring( 0, name.length ) ) )
	{
	  return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}
// this deletes the cookie when called
function Delete_Cookie( name, path, domain )
{
	 if ( Get_Cookie( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
/////////////////////////////////
// File Name: mBanner.js       //
// By: Manish Kumar Namdeo     //
/////////////////////////////////

// BANNER OBJECT
function Banner(objName){
	this.obj = objName;
	this.aNodes = [];
	this.currentBanner = 0;
	
};

// ADD NEW BANNER
Banner.prototype.add = function(bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
	this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};

// Node object
function Node(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
	this.name = name;
	this.bannerType = bannerType;
	this.bannerPath = bannerPath;
	this.bannerDuration = bannerDuration;
	this.height = height
	this.width = width;
	this.hyperlink= hyperlink;
};

// Outputs the banner to the page
Banner.prototype.toString = function() {
	var str = "";
	for (var iCtr=0; iCtr < this.aNodes.length; iCtr++){
		str = str + '<span name="'+this.aNodes[iCtr].name+'" '
		str = str + 'id="'+this.aNodes[iCtr].name+'" ';
		str = str + 'class="m_banner_hide" ';
		str = str + 'bgcolor="#FFFCDA" ';	// CHANGE BANNER COLOR HERE
		str = str + 'align="center" ';
		str = str + 'valign="top" >\n';
		if (this.aNodes[iCtr].hyperlink != ""){
			str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'">';
		}
			
		if ( this.aNodes[iCtr].bannerType == "FLASH" ){
			str = str + '<OBJECT '
			str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
			str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
			str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
			str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
			str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
			str = str + 'ALIGN="" '
			str = str + 'VIEWASTEXT>'
			str = str + '<PARAM NAME="wmode" VALUE="transparent">'
			str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
			str = str + '<PARAM NAME=quality VALUE=high>'
			str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
			str = str + '<EMBED wmode="transparent" ';
			str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
			str = str + 'quality=high '
//			str = str + 'bgcolor=#FFFCDA '
			str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
			str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
			str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
			str = str + 'ALIGN="center" '
			str = str + 'TYPE="application/x-shockwave-flash" '
			str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
			str = str + '</EMBED>'
			str = str + '</OBJECT>'
		}else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
			str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
			str = str + 'border="0" ';
			str = str + 'height="'+this.aNodes[iCtr].height+'" ';
			str = str + 'width="'+this.aNodes[iCtr].width+'">';
		}

		if (this.aNodes[iCtr].hyperlink != ""){
			str = str + '</a>';
		}

		str += '</span>';
	}
	return str;
};

// START THE BANNER ROTATION
Banner.prototype.start = function(){
    this.changeBanner();  
	var thisBannerObj = this.obj;
	// CURRENT BANNER IS ALREADY INCREMENTED IN cahngeBanner() FUNCTION
	//setTimeout(thisBannerObj+".start()", this.aNodes[this.currentBanner].bannerDuration * 1000);
	var countvar =   intduration - 1; 
	if(parseInt(Get_Cookie('currenttimecounter'+sessID),10) > 0 && parseInt(Get_Cookie('currenttimecounter'+sessID),10) < countvar) {
		var remainingDuration =  this.aNodes[this.currentBanner].bannerDuration - parseInt(Get_Cookie('currenttimecounter'+sessID),10);
	} else {
		var  remainingDuration =  this.aNodes[this.currentBanner].bannerDuration;
	}
	if(remainingDuration < 0) {
		remainingDuration = 0;
	}
	setTimeout(thisBannerObj+".start()", remainingDuration * 1000);
}

// CHANGE BANNER
Banner.prototype.changeBanner = function(){
    var thisBanner;
	var prevBanner = -1;
	
	if (this.currentBanner < this.aNodes.length ){
	    
		//check for cookie set
	    if(parseInt(Get_Cookie('mycurrentbanner'+sessID),10)) {
	    	 
    		 this.currentBanner =  parseInt(Get_Cookie('mycurrentbanner'+sessID),10);
    		
    	} else {
	         this.currentBanner = 0;
	    }
	    thisBanner = this.currentBanner;  
		if (this.aNodes.length > 1){
			if ( thisBanner > 0 ){
				prevBanner = thisBanner - 1;
			}else{
				prevBanner = this.aNodes.length-1;
			}
		}
		
		if (this.currentBanner < this.aNodes.length - 1){
		    this.currentBanner = this.currentBanner + 1;
		}else{
			this.currentBanner = 0;
		}
		
	}
	if (prevBanner >= 0){
		document.getElementById(this.aNodes[prevBanner].name).className = "m_banner_hide";
	}
	for(i=0;i<thisBanner;i++) {
		document.getElementById(this.aNodes[i].name).className = "m_banner_hide";    
	}
	for(i=thisBanner;i<this.aNodes.length;i++) {
		document.getElementById(this.aNodes[i].name).className = "m_banner_hide";    
	}
	
	document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show";  
	/*if(this.aNodes[thisBanner].name == null || this.aNodes[thisBanner].name == "")
		document.getElementById(this.aNodes[0].name).className = "m_banner_show";
	else
		document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show";*/
	//Set value of currentBanner in a cookie
	Delete_Cookie('mycurrentbanner'+sessID,'/');
	Set_Cookie('mycurrentbanner'+sessID,this.currentBanner ,30,"/", "", "");  
	//Set value of bannerduration in a cookie
	Delete_Cookie('mybannerduration'+sessID,'/');
	Set_Cookie('mybannerduration'+sessID,this.aNodes[this.currentBanner].bannerDuration ,30,"/", "", "");
	
}



/*------------#Banner functions end#----*/   
function dDown() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function expandcollapse (postid) {
whichpost = document.getElementById(postid);
if (document.getElementById('a10')) { whichposta10 = document.getElementById('a10'); } else { whichposta10 = ""; }
if (document.getElementById('a100')) { whichposta100 = document.getElementById('a100'); } else { whichposta100 = ""; }
if (document.getElementById('a11')) { whichposta11 = document.getElementById('a11'); } else { whichposta11 = ""; }

if (document.getElementById('a110')) { whichposta110 = document.getElementById('a110'); } else { whichposta110 = ""; }
if (document.getElementById('a12')) { whichposta12 = document.getElementById('a12'); } else { whichposta12 = ""; }
if (document.getElementById('a120')) { whichposta120 = document.getElementById('a120'); } else { whichposta120 = ""; }
if (document.getElementById('a13')) { whichposta13 = document.getElementById('a13'); } else { whichposta13 = ""; }
if (document.getElementById('a130')) { whichposta130 = document.getElementById('a130'); } else { whichposta130 = ""; }
if (document.getElementById('a14')) { whichposta14 = document.getElementById('a14'); } else { whichposta14 = ""; }
if (document.getElementById('a140')) { whichposta140 = document.getElementById('a140'); } else { whichposta140 = ""; }
if (document.getElementById('a15')) { whichposta15 = document.getElementById('a15'); } else { whichposta15 = ""; }
if (document.getElementById('a150')) { whichposta150 = document.getElementById('a150'); } else { whichposta150 = ""; }

if (document.getElementById('a17')) { whichposta17 = document.getElementById('a17'); } else { whichposta17 = ""; }
if (document.getElementById('a170')) { whichposta170 = document.getElementById('a170'); } else { whichposta170 = ""; }


if (postid=="a10") {
	whichposta10.className="postshow"
	whichposta100.className="introduction"
	whichposta11.className="posth"
	whichposta110.className="featuresh"
	whichposta12.className="posth"
	whichposta120.className="specificationsh"
	whichposta13.className="posth"
	whichposta130.className="helph"
	whichposta14.className="posth"
	whichposta140.className="imagesh"
	whichposta15.className="posth"
	whichposta150.className="trainingh"
    whichposta17.className="posth"
    whichposta170.className="trainingh"
    
    
}
if (document.getElementById('a11')) { if (postid=="a11") {
	whichposta10.className="posth"
	whichposta100.className="introductionh"
	whichposta11.className="postshow"
	whichposta110.className="features"
	whichposta12.className="posth"
	whichposta120.className="specificationsh"
	whichposta13.className="posth"
	whichposta130.className="helph"
	whichposta14.className="posth"
	whichposta140.className="imagesh"
	whichposta15.className="posth"
	whichposta150.className="trainingh"
    whichposta17.className="posth"
    whichposta170.className="trainingh"
    
} }
if (document.getElementById('a12')) { if (postid=="a12") {
	whichposta10.className="posth"
	whichposta100.className="introductionh"
	whichposta11.className="posth"
	whichposta110.className="featuresh"
	whichposta12.className="postshow"
	whichposta120.className="specifications"
	whichposta13.className="posth"
	whichposta130.className="helph"
	whichposta14.className="posth"
	whichposta140.className="imagesh"
	whichposta15.className="posth"
	whichposta150.className="trainingh"
    whichposta17.className="posth"
    whichposta170.className="trainingh"
    
} }
if (document.getElementById('a13')) { if (postid=="a13") {
	whichposta10.className="posth"
	whichposta100.className="introductionh"
	whichposta11.className="posth"
	whichposta110.className="featuresh"
	whichposta12.className="posth"
	whichposta120.className="specificationsh"
	whichposta13.className="postshow"
	whichposta130.className="help"
	whichposta14.className="posth"
	whichposta140.className="imagesh"
	whichposta15.className="posth"
	whichposta150.className="trainingh"
    whichposta17.className="posth"
    whichposta170.className="trainingh"

} }
if (document.getElementById('a14')) { if (postid=="a14") {
	whichposta10.className="posth"
	whichposta100.className="introductionh"
	whichposta11.className="posth"
	whichposta110.className="featuresh"
	whichposta12.className="posth"
	whichposta120.className="specificationsh"
	whichposta13.className="posth"
	whichposta130.className="helph"
	whichposta14.className="postshow"
	whichposta140.className="images"
	whichposta15.className="posth"
	whichposta150.className="trainingh"
    whichposta17.className="posth"
    whichposta170.className="trainingh"
    
} }
if (document.getElementById('a15')) { if (postid=="a15") {
	whichposta10.className="posth"
	whichposta100.className="introductionh"
	whichposta11.className="posth"
	whichposta110.className="featuresh"
	whichposta12.className="posth"
	whichposta120.className="specificationsh"
	whichposta13.className="posth"
	whichposta130.className="helph"
	whichposta14.className="posth"
	whichposta140.className="imagesh"
	whichposta15.className="postshow"
	whichposta150.className="training"
    whichposta17.className="posth"
    whichposta170.className="trainingh"
    
} }
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

function myPopup2(location) {
	window.open( location, "myWindow",
	"scrollbars = 1, status = 0, height = 300, width = 250, resizable = 0" )
}

function trim(s)
{
	s = s.replace( /^\s*/, "" );
	return s.replace( /\s*$/, "" );
}

function checkemail()
{
	stremail = document.frmemail.email1.value;
	if(stremail == "")
	{
		alert("Please enter your email address.");
		return false;
	}

	if (trim(document.frmemail.securitycode.value)=="")
	{
		alert("Please enter security code.");
		document.frmemail.securitycode.focus();
		return false;
	}
}

function writeFlash(flashdata)
{
document.write(flashdata);
} 

// New code added for image/video tabbed functioning in products.
this.gallery = function(){
	var gal = document.getElementById("gallery");
	if(gal){
		var dir="";
	
		var tabs = document.createElement("ul");		
		tabs.className = "tabs";	
	
		if (imageThumbs.length > 0) {
			li = document.createElement("li");
			a = document.createElement("a");
			a.href = "javascript:void(0);";
			a.innerHTML = "Images";
			a.onclick = function(){toggle(0);};
			li.appendChild(a);
			tabs.appendChild(li);
		};	
		if (videoThumbs.length > 0) {
			li = document.createElement("li");
			a = document.createElement("a");
			a.href = "javascript:void(0);";
			a.innerHTML = "Videos";
			a.onclick = function(){toggle(1);};
			li.appendChild(a);
			tabs.appendChild(li);			
		};
		gal.appendChild(tabs);			
	
		var content = document.createElement("div");		
		content.className = "content";

		ul = document.createElement("ul");
		for(var i=0;i<imageThumbs.length;i++){
			var li = document.createElement("li");
			var a = document.createElement("a");
			var img = new Image();
			img.src = imageThumbs[i];
			a.appendChild(img);
			a.href = "javascript:void(0);";
			a.i = i;
			a.onclick = function(){
				show(0,images[this.i],this.i);
			};
			li.appendChild(a);
			ul.appendChild(li)			
		};
		ul.style.display = "block";		
		content.appendChild(ul);	
	
		ul = document.createElement("ul");
		for(var i=0;i<videoThumbs.length;i++){
			var li = document.createElement("li");
			var a = document.createElement("a");
			var img = new Image();
			img.src = videoThumbs[i];
			a.appendChild(img);
			a.href = "javascript:void(0);";
			a.i = i;
			a.onclick = function(){
				show(1,videos[this.i],this.i);
			};			
			li.appendChild(a);
			ul.appendChild(li)
		};
		ul.style.display = "none";			
		content.appendChild(ul);
	
		gal.appendChild(content);
		
		controls = document.createElement("ul");
		rw = document.createElement("li");	
		ff = document.createElement("li");
		rwa = document.createElement("a");
		ffa = document.createElement("a");
		rwa.href = "javascript:void(0);";
		ffa.href = "javascript:void(0);";
		rwa.innerHTML = " << ";
		ffa.innerHTML = " >> ";		
		
		rwa.onmousedown = function(){dir="rw";};
		rwa.onmouseup = function(){dir="";};		
		ffa.onmousedown = function(){dir="ff";};
		ffa.onmouseup = function(){dir="";};		
		
		controls.className = "inverseTabs";
		rw.appendChild(rwa);
		ff.appendChild(ffa);
		controls.appendChild(rw);
		controls.appendChild(ff);
		
		gal.appendChild(controls);
	
		this.toggle = function(id){
			uls = content.getElementsByTagName("ul");
			for(i=0;i<uls.length;i++){
				uls[i].style.display = (id == i) ? "block" : "none";
			};
		};
		
		this.scrl = function(){
			var ul;
			uls = content.getElementsByTagName("ul");
			for(i=0;i<uls.length;i++){
				if (uls[i].style.display == "block") ul = uls[i];
			}; 
			var left = ul.style.left.replace("px","");if(left=="")left=0;left=parseInt(left);
			if(dir == "ff"){
				if(ul.offsetWidth + left > content.offsetWidth) ul.style.left = (left-10)+"px";
			};
			if(dir == "rw"){
				if(left < 0) ul.style.left = (left+10)+"px"
			};
			setTimeout(this["scrl"],50);
		};
		scrl();
		
		this.show = function(type,value,index){
			var productImage = document.getElementById("productImage");
			if(productImage){
				productImage.innerHTML = "";
				productImage.style.background = "#fff";
				if(type == 0)
				{
					var bv=navigator.userAgent;
					var ver=bv.search(/Firefox\//);
					var bver=bv.substring(ver+8,bv.length);
					var bname=bv.substring(ver,ver+8);
					if(bname=="Firefox/" && bver=="1.0.7" )
					{
						alert("Please note our large image display requires Firefox 1.5 and above to display correctly. Your browser is an older version.  Please visit www.mozilla.com/en-US/firefox/ to upgrade. Our video loader will work with your older broswer.");
					};
					if(bver!="1.0.7")
					{
					    img = new Image();
					    img.onload = function(){
						productImage.appendChild(img);
						if (imagesLarge[index] != ""){
							p = document.createElement("p");
							a = document.createElement("a");
							a.innerHTML = " ";
							a.href = "javascript:void(0);"
							a.onclick = function()
							{
								
								window.open("http://www.heliguy.com/popup.htm?"+imagesLarge[index], "",  
		 "resizable=1,HEIGHT=200,WIDTH=200"); 
							};
							a.innerHTML = "Click here for larger image.";
							p.appendChild(a);						
							productImage.appendChild(p);
						};							
					};	
					
					img.src = value;
				    };
				};
				if(type == 1){
					productImage.style.background = "#fff url('http://www.heliguy.com/images/video_loading.gif') no-repeat 40% 40%";
					productImage.style.height = "250px";
					fwidth = 350;
					fheight = 250;
					//html = '<object width="' + fwidth + '" height="' + fheight + '"><param name="movie" value="' + value + '" /><param name="wmode" value="transparent" /><embed src="' + value + '" type="application/x-shockwave-flash" wmode="transparent" width="' + fwidth + '" height="' + fheight + '"></embed></object>'
					//html = '<object type="application/x-shockwave-flash" data="' + value + '" width="' + fwidth + '" height="' + fheight + '"><param name="movie" value="' + value + '" /></object>';
					
					html = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="'+ fwidth +'" HEIGHT="'+ fheight +'" id="video" style="z-index:0;"><PARAM NAME=movie VALUE="'+ value +'"><PARAM NAME=wmode VALUE=transparent><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="'+ value +'" quality=high bgcolor=#FFFFFF WIDTH="'+ fwidth +'" HEIGHT="'+ fheight +'" wmode=transparent NAME="swf" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
					productImage.innerHTML = html;
					
				};				
			};
		};
		
	};
};

function clickIE4(){
	/*
	if (event.button==2){
	alert("Content is copyright material of heliguy.com.");
	return false;
	}*/
}

/*
     #############################################################################
     # Function Name: NewWindow()
     # Created By: PHP Team   
     # Created on: 12  Sep 2005
     # Purpose: This function will open passed url in new window.
     # Parameters: string url : Url
	 #                    string title : Window Title
	 #                    string w : window width
	 #                    string h : window height 
	 #                    string scroll : boolean value will indicate wether window should contain scroll bars or not (true/false, 'yes'/ 'no')
	 #                    string resize : boolean value will indicate wether window is resizable or not (true/false, 'yes'/ 'no')
     # ON SUCCESS: open url in new window.     
     #############################################################################
	 */

	 function NewWindow(url, title, w, h, scroll, resize) 
	 {
		 
		 if (scroll==true || scroll=='yes') 
		 {
			 scroll='yes'; 
		 }
		 else 
		 {
			 scroll='no'; 
		 }
		 if (resize==true || resize=='yes') 
		 {
			 resize=', resizable'; 
		 }
		 else 
		 {
			 resize=''; 
		 }
		 var winl = (screen.width - w) / 2; 
		 var wint = (screen.height - h) / 2; 
		 winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+resize;
		 win = window.open(url, title, winprops);
	 }
	 
function expandcollapse1 (postid) {
whichpost = document.getElementById(postid);

if (document.getElementById('a10')) { whichposta10 = document.getElementById('a10'); } else { whichposta10 = ""; }
if (document.getElementById('a100')) { whichposta100 = document.getElementById('a100'); } else { whichposta100 = ""; }

if (document.getElementById('a11')) { whichposta11 = document.getElementById('a11'); } else { whichposta11 = ""; }
if (document.getElementById('a110')) { whichposta110 = document.getElementById('a110'); } else { whichposta110 = ""; }

if (document.getElementById('a12')) { whichposta12 = document.getElementById('a12'); } else { whichposta12 = ""; }
if (document.getElementById('a120')) { whichposta120 = document.getElementById('a120'); } else { whichposta120 = ""; }

if (document.getElementById('a13')) { whichposta13 = document.getElementById('a13'); } else { whichposta13 = ""; }
if (document.getElementById('a130')) { whichposta130 = document.getElementById('a130'); } else { whichposta130 = ""; }

if (document.getElementById('a14')) { whichposta14 = document.getElementById('a14'); } else { whichposta14 = ""; }
if (document.getElementById('a140')) { whichposta140 = document.getElementById('a140'); } else { whichposta140 = ""; }
if (document.getElementById('a15')) { whichposta15 = document.getElementById('a15'); } else { whichposta15 = ""; }
if (document.getElementById('a150')) { whichposta150 = document.getElementById('a150'); } else { whichposta150 = ""; }
if (document.getElementById('a16')) { whichposta16 = document.getElementById('a16'); } else { whichposta16 = ""; }
if (document.getElementById('a160')) { whichposta160 = document.getElementById('a160'); } else { whichposta160 = ""; }
if (document.getElementById('a17')) { whichposta17 = document.getElementById('a17'); } else { whichposta17 = ""; }
if (document.getElementById('a170')) { whichposta170 = document.getElementById('a170'); } else { whichposta170 = ""; }




if (postid=="a10") {
	whichposta10.className="one"
	whichposta100.className="selected"
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta12.className="hidden"
	whichposta120.className="" 
	whichposta13.className="hidden"
	whichposta130.className="" 
	whichposta14.className="hidden"
	whichposta140.className=""
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""                   
    whichposta17.className="hidden"
    whichposta170.className=""          
	
}
if (document.getElementById('a11')) { if (postid=="a11") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	
	whichposta11.className="one"
	whichposta110.className="selected"
	
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className="" 
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""                   
    whichposta17.className="hidden"
    whichposta170.className=""          
	
} }
if (document.getElementById('a12')) { if (postid=="a12") {
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta12.className="one"
	whichposta120.className="selected"
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className="" 
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""                    
    whichposta17.className="hidden"
    whichposta170.className=""          
	
} }

if (document.getElementById('a13')) { if (postid=="a13") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta13.className="one"
	whichposta130.className="selected"
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta14.className="hidden"
	whichposta140.className="" 
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""                   
    whichposta17.className="hidden"
    whichposta170.className=""          
	
} }
if (document.getElementById('a14')) { if (postid=="a14") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="one"
	whichposta140.className="selected"
	whichposta15.className="hidden"
	whichposta150.className="" 
	whichposta16.className="hidden"
	whichposta160.className=""          
    whichposta17.className="hidden"
    whichposta170.className=""          
	
} }
if (document.getElementById('a15')) { if (postid=="a15") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className=""
	whichposta15.className="one"
	whichposta150.className="selected"
	whichposta16.className="hidden"
	whichposta160.className=""               
    whichposta17.className="hidden"
    whichposta170.className=""          
	
} }
if (document.getElementById('a16')) { if (postid=="a16") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className=""
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="one"
	whichposta160.className="selected"          
    whichposta17.className="hidden"
    whichposta170.className=""          

	
} }


if (document.getElementById('a17')) { if (postid=="a17") {
    //alert('here');
    whichposta10.className="hidden"
    whichposta100.className=""
    whichposta11.className="hidden"
    whichposta110.className=""
    whichposta12.className="hidden"
    whichposta120.className=""
    whichposta13.className="hidden"
    whichposta130.className=""
    whichposta14.className="hidden"
    whichposta140.className=""
    whichposta15.className="hidden"
    whichposta150.className=""
    whichposta16.className="hidden"
    whichposta160.className=""          
    whichposta17.className="one"
    whichposta170.className="selected"          

    
    
} }


}
function expandcollapse2 (postid,id) {  
   whichpost = document.getElementById(postid);
   if (document.getElementById(id+'10')) { whichposta10 = document.getElementById(id+'10'); } else { whichposta10 = ""; }
	if (document.getElementById(id+'100')) { whichposta100 = document.getElementById(id+'100'); } else { whichposta100 = ""; }

	if (document.getElementById(id+'11')) { whichposta11 = document.getElementById(id+'11'); } else { whichposta11 = ""; }
	if (document.getElementById(id+'110')) { whichposta110 = document.getElementById(id+'110'); } else { whichposta110 = ""; }

	if (document.getElementById(id+'12')) { whichposta12 = document.getElementById(id+'12'); } else { whichposta12 = ""; }
	if (document.getElementById(id+'120')) { whichposta120 = document.getElementById(id+'120'); } else { whichposta120 = ""; }

	if (document.getElementById(id+'13')) { whichposta13 = document.getElementById(id+'13'); } else { whichposta13 = ""; }
	if (document.getElementById(id+'130')) { whichposta130 = document.getElementById(id+'130'); } else { whichposta130 = ""; }
	
	if (document.getElementById(id+'14')) { whichposta14 = document.getElementById(id+'14'); } else { whichposta14 = ""; }
	if (document.getElementById(id+'140')) { whichposta140 = document.getElementById(id+'140'); } else { whichposta140 = ""; }
	
	if (document.getElementById(id+'15')) { whichposta15 = document.getElementById(id+'15'); } else { whichposta15 = ""; }
	if (document.getElementById(id+'150')) { whichposta150 = document.getElementById(id+'150'); } else { whichposta150 = ""; }
	
	if (document.getElementById(id+'16')) { whichposta16 = document.getElementById(id+'16'); } else { whichposta16 = ""; }
	if (document.getElementById(id+'160')) { whichposta160 = document.getElementById(id+'160'); } else { whichposta160 = ""; }

if (postid== id+"10") {
	whichposta10.className="one"
	whichposta100.className="selected"
	whichposta11.className="hidden"
	whichposta110.className=""    
	whichposta12.className="hidden"
	whichposta120.className="" 
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className=""     
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""                
	
}
if (document.getElementById(id+'11')) { if (postid== id+"11") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="one"
	whichposta110.className="selected"
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className=""     
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""              
	
} }
if (document.getElementById(id+'12')) { if (postid== id+"12") {
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta12.className="one"
	whichposta120.className="selected"
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta14.className="hidden"
	whichposta140.className=""     
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""              
	
} }

if (document.getElementById(id+'13')) { if (postid== id+"13") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta13.className="one"
	whichposta130.className="selected"
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta14.className="hidden"
	whichposta140.className=""     
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""              
	
} } 

if (document.getElementById(id+'14')) { if (postid== id+"14") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta14.className="one"
	whichposta140.className="selected"     
	whichposta15.className="hidden"
	whichposta150.className=""
	whichposta16.className="hidden"
	whichposta160.className=""              
	
} } 

if (document.getElementById(id+'15')) { if (postid== id+"15") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta14.className="hidden"
	whichposta140.className=""     
	whichposta15.className="one"
	whichposta150.className="selected" 
	whichposta16.className="hidden"
	whichposta160.className=""         
	
} }
if (document.getElementById(id+'16')) { if (postid== id+"16") {
	//alert('here');
	whichposta10.className="hidden"
	whichposta100.className=""
	whichposta11.className="hidden"
	whichposta110.className=""
	whichposta13.className="hidden"
	whichposta130.className=""
	whichposta12.className="hidden"
	whichposta120.className=""
	whichposta14.className="hidden"
	whichposta140.className=""     
	whichposta15.className="hidden"
	whichposta150.className=""     
	whichposta16.className="one"
	whichposta160.className="selected"        
	
} }  
   
}

function postageSystem(postage){
    if (postage==''){
        document.getElementById('royal_tracked').style.display = 'block';
    }else if (postage!='signed_first' && postage!='signed_second'){
        document.getElementById('royal_tracked').style.display = 'none';
        document.getElementById('updatepostage').submit();
    }else{
 /*       var sign = confirm('You want signed for '+postage);
        //alert(sign);
        if (sign){
            document.getElementById('signed').value='signed';
        }else{
            document.getElementById('signed').value='';
        }
        document.getElementById('updatepostage').submit(); */        
        document.getElementById('signedFor').style.display = 'block';
        document.getElementById('royal_tracked').style.display = 'none';
        //window.location.href = "details.html?height=300&width=300";
        //$('#thickBlink').click();
    }
}

//Added By hardik
function postageInternational(){
    document.getElementById('signedFor').style.display = 'block';
}

function selectRoyal(){
document.getElementById('updatepostage').postage.value = 'royal_tracked';
//for (cnt=0;cnt<document.getElementById('updatepostage').postage.length;cnt++){
//  if (document.getElementById('updatepostage').postage[cnt].value == 'royal_tracked'){
//    document.getElementById('updatepostage').postage[cnt].selected = true;
//    document.getElementById('updatepostage').submit();
//  }
//}
  document.getElementById('updatepostage').submit();
}