//animated slide script
var sliderIntervalId = 0;
var sliderHeight = 355;
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('step3Off').style.display='none';
	//document.getElementById('step3On').style.display='block';
	
   slider = document.getElementById('productSelectorFlash');
   if(sliderHeight <= 273)
   {
      sliding = false;
      sliderHeight = 273;
      slider.style.height = '273px';
      clearInterval(sliderIntervalId);
   }
   else
   {
      sliderHeight -= slideSpeed;
      if(sliderHeight <273)
    	  sliderHeight = 273;
      	slider.style.height = sliderHeight + 'px';
   }
}
	
function SlideDownRun(){
	
	//document.getElementById('step3Off').style.display='block';
	//document.getElementById('step3On').style.display='none';

	
	slider = document.getElementById('productSelectorFlash');
	
	if(sliderHeight>= 355){
	  sliding = false;
	  sliderHeight = 355;
	  slider.style.height = '355px';
	  clearInterval(sliderIntervalId);
	}
	else
	{
	sliderHeight += slideSpeed;
	if(sliderHeight> 355)
	sliderHeight = 355;
	slider.style.height = sliderHeight + 'px';
	}
}
	
//slide script without animation
function slideDown() {
	 //document.getElementById('topFlash').style.marginTop='-25px';
	 document.getElementById('productSelectorFlash').style.height='355px';			 	
	 //document.getElementById('step3On').style.display='none';	
	 //document.getElementById('step3Off').style.display='block';		 	 		 
}
function slideUp() {
	 //make layer visible
	 document.getElementById('productSelectorFlash').style.height='273px';
	 //document.getElementById('step3Off').style.display='none';	
	 //document.getElementById('step3On').style.display='block';
}


function showThirdDiv () {
	document.getElementById('step3Off').style.display='none';
	document.getElementById('step3On').style.display='block';
}	

function hideThirdDiv () {	
	document.getElementById('step3Off').style.display='block';
	document.getElementById('step3On').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("prodProblem") + 13);
	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") {
		prsHFN4 = "Contact_Flash_Assisted_" + OmProdYear;
	} else if (OmProd == "4") {
		prsHFN4 = "Contact_Flash_Standard_" + OmProdYear;
	} else if (OmProd == "8") {
		prsHFN4 = "Contact_Flash_Enhanced_" + OmProdYear;
	} else if (OmProd == "16") {
		prsHFN4 = "Contact_Flash_Basic_" + OmProdYear;
	} else if (OmProd == "32") {
		prsHFN4 = "Contact_Flash_Complete";
	} else if (OmProd == "64") {
		prsHFN4 = "Contact_Flash_IOP";
	} else if (OmProd == "256") {
		prsHFN4 = "Contact_Flash_QBOP";
	}
	
	var scVariableMap = {};
	var scEventList = [];
	var scContStep1 = prsHFN4;
	var scLinkType = "o";
	var scContStep1Om = new CustomLink(scVariableMap,scEventList,scContStep1,scLinkType);
	
	sendCustomLink(scContStep1Om,this);
	*/
	window.location = window.location.protocol + "//" + window.location.host + addThis;
}