//animated slide script
var sliderIntervalId = 0;
var sliderHeight = 300;
var sliding = false;
var slideSpeed = 20;
	
function SlideU(){
   if(sliding)
      return;
   sliding = true;
   sliderIntervalId = setInterval('SlideUpRun()', 20);
}
	
function SlideD(){
   if(sliding)
      return;
   sliding = true;
   sliderIntervalId = setInterval('SlideDownRun()', 20);
}
	
function SlideUpRun(){ 
	
/*	document.getElementById('step2Off').style.display='none';
	document.getElementById('step2On').style.display='block';
	
   slider = document.getElementById('productSelectorFlash');
   if(sliderHeight <= 70)
   {
      sliding = false;
      sliderHeight = 70;
      slider.style.height = '70px';
      clearInterval(sliderIntervalId);
   }
   else
   {
      sliderHeight -= slideSpeed;
      if(sliderHeight <70)
    	sliderHeight = 70;
      	slider.style.height = sliderHeight + 'px';
   } */
}
	
function SlideDownRun(){
	
	/* document.getElementById('step2Off').style.display='block';
	document.getElementById('step2On').style.display='none';
	slider = document.getElementById('productSelectorFlash');
	if(sliderHeight>= 300){
	  sliding = false;
	  sliderHeight = 300;
	  slider.style.height = '300px';
	  clearInterval(sliderIntervalId);
	}
	else
	{
	sliderHeight += slideSpeed;
	if(sliderHeight> 300)
	sliderHeight = 300;
	slider.style.height = sliderHeight + 'px';
	} */
}
	
//slide script without animation
function slideDown() {
	 // document.getElementById('topFlash').style.marginTop='-25px';
	 // document.getElementById('productSelectorFlash').style.height='300px';			 	
	 document.getElementById('step2On').style.display='none';	
	 document.getElementById('step2Off').style.display='block';		 	 		 
}
function slideUp() {
	 //make layer visible
	 document.getElementById('productSelectorFlash').style.height='70px';
	 document.getElementById('step2Off').style.display='none';	
	 document.getElementById('step2On').style.display='block';
}

function showThirdDiv () {
	var s2of = document.getElementById('step2Off')
	var s2on = document.getElementById('step2On')
	if (s2of != null) {
		document.getElementById('step2Off').style.display='none';
		document.getElementById('step2On').style.display='block';
	}
}	

function hideThirdDiv () {	
	document.getElementById('step2Off').style.display='block';
	document.getElementById('step2On').style.display='none';	
}


//Flash Embed - contact us page with cookie read
if (document.cookie != "") {
	//Product Name Cookie
	/*var aCookie = document.cookie.split("; ");
	  for (var i=0; i < aCookie.length; i++) {
	    // a name/value pair (a crumb) is separated by an equal sign
	    var aCrumb = aCookie[i].split("=");
	    if (aCrumb[0] == "prs_user") {
	    var finalCrumb = aCrumb[1].split("|");
	    var finalProduct = finalCrumb[0];
	    var finalYear = finalCrumb[1];
	   }
	  }*/
	var countbeginb = (document.cookie.indexOf("prodProblem") + 12);
	var countendb = document.cookie.indexOf(";");
	sValueb = document.cookie.substring( countbeginb, countendb );
	var myPropertyValuePairs = "prodName=" + ppr + "&prodYear=" + ppy + "&prodProblem=" + sValueb;
	} else {
	var myPropertyValuePairs = "";
}
var c=">"; // I will use the closing tag more than once
var oC="<OBJECT classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' ";
var cB=" codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\' ";
var pN=" <PARAM NAME=movie  VALUE=" 
var pQ=" <PARAM NAME=quality VALUE=best> ";
var pW=" <PARAM NAME=wmode VALUE=transparent> ";
var pB=" <PARAM NAME=bgcolor VALUE="; 
var bG="#FFFFFF";
var eS=" <EMBED src=";
var eQ=" quality=best ";
var eW=" wmode=transparent ";
var eB=" bgcolor=";
var eT=" TYPE=\'application/x-shockwave-flash\' ";
var eP= "PLUGINSPAGE=\'http://get.adobe.com/flashplayer/\'> ";
var eO=" </EMBED> </OBJECT> ";
// the last step
var line01=oC+cB;
var lineM = pN;
var line02=c+pQ+pW+pB+bG+c+eS;
var line03=eQ+eW+eB+bG;
var lineM2 = eT+eP+eO;

function gup( name, OmString )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( OmString );
  if( results == null ) {
    return "";
    
  } else {
    return results[1];
  }
}

function pageRefresh (addThis){
	
	var OmProd = gup( 'service', addThis );
	var OmProdYear = gup( 'yr', addThis  );
	
	if (OmProd == "2") {
		//sendClickEvent("Home_Flash_" +  OmProd + "_" + OmProdYear)
		prsHFN = "Home_Flash_Assisted_" + OmProdYear;
	} else if (OmProd == "4") {
		prsHFN = "Home_Flash_Standard_" + OmProdYear;
	} else if (OmProd == "8") {
		prsHFN = "Home_Flash_Enhanced_" + OmProdYear;
	} else if (OmProd == "16") {
		prsHFN = "Home_Flash_Basic_" + OmProdYear;
	} else if (OmProd == "32") {
		prsHFN = "Home_Flash_Complete";
	} else if (OmProd == "64") {
		prsHFN = "Home_Flash_IOP";
	} else if (OmProd == "256") {
		prsHFN = "Home_Flash_QBOP";
	}
	
	var scVariableMap = {};
	var scEventList = [];
	var scHomeStep1 = prsHFN;
	var scLinkType = "o";
	var scHomeStep1Om = new CustomLink(scVariableMap,scEventList,scHomeStep1,scLinkType);
	
	sendCustomLink(scHomeStep1Om,this);
	
	
	window.location = window.location.protocol + "//" + window.location.host + addThis;
}




