/*
	This code is to allow Javascript to communcted to the Server in order to update it
*/

//
// Define a list of Microsoft XML HTTP ProgIDs.
//
var XMLHTTPREQUEST_MS_PROGIDS = new Array(
  "Msxml2.XMLHTTP.7.0",
  "Msxml2.XMLHTTP.6.0",
  "Msxml2.XMLHTTP.5.0",
  "Msxml2.XMLHTTP.4.0",
  "MSXML2.XMLHTTP.3.0",
  "MSXML2.XMLHTTP",
  "Microsoft.XMLHTTP"
);

//
// Define ready state constants.
//
var XMLHTTPREQUEST_READY_STATE_UNINITIALIZED = 0;
var XMLHTTPREQUEST_READY_STATE_LOADING       = 1;
var XMLHTTPREQUEST_READY_STATE_LOADED        = 2;
var XMLHTTPREQUEST_READY_STATE_INTERACTIVE   = 3;
var XMLHTTPREQUEST_READY_STATE_COMPLETED     = 4;
//

//
// Returns XMLHttpRequest object. 
//
function getXMLHttpRequest()
{
  var httpRequest = null;

  // Create the appropriate HttpRequest object for the browser.
  if (window.XMLHttpRequest != null)
    httpRequest = new window.XMLHttpRequest();
  else if (window.ActiveXObject != null)
  {
    // Must be IE, find the right ActiveXObject.
    var success = false;
    for (var i = 0;i < XMLHTTPREQUEST_MS_PROGIDS.length && !success;i++)
    {
      try
      {
        httpRequest = new ActiveXObject(XMLHTTPREQUEST_MS_PROGIDS[i]);
        success = true;
      }
      catch (ex)
      {}
    }
  }

  // Display an error if we couldn't create one.
  if (httpRequest == null)
    alert("Error in HttpRequest():\n\n"
      + "Cannot create an XMLHttpRequest object.");

  // Return it.
  return httpRequest;
}

//Adds text to any part of the body of a HTML
function addNode(tagParent,strText,boolAddToBack, boolRemoveNode)
{
  var strNode = document.createTextNode(strText);//holds the test which will be added
     
  //gets the properties of the node
  tagParent = getDocID(tagParent);
  
  //checks if the user whats to replace the node in order to start with a clean slate
  //it also checks if there is a chode node to replace
  if (boolRemoveNode == true && tagParent.childNodes.length > 0)
	//replaces the current node with what the user wants
	tagParent.replaceChild(strNode,tagParent.childNodes[0]);
  else
  {
  	//checks if the user whats to added to the back of the id or the front
  	if(boolAddToBack == true)
		tagParent.appendChild(strNode);
  	else
		//This is a built-in function of Javascript will add text to the beginning of the child
  		insertBefore(strNode,tagParent.firstChild);
  }//end of if else
  
  //returns the divParent in order for the user to use it for more uses
  return tagParent;
}//end of addNode()

//changes the colour of tagTarget to be more dim or removes it
function changeColour(tagTarget)
{
	//gets the properties of tagTarget
	tagTarget = getDocID(tagTarget);

	//checks if there is a tagTarget on the page
	if(tagTarget != null)
	{
		//sets the style to be dim or to remove it
		if(tagTarget.style.opacity == "")
		{
			tagTarget.style.opacity = "0.5";
			tagTarget.style.filter = "alpha(opacity=50)";
		}//end of if
		else
		{
			tagTarget.style.opacity = "";
			tagTarget.style.filter = "";
		}//end of else
	}//end of if
}//end of changeColour()

//changes the embed object of object tag
//It assumes the tagMovie and tagEmbed already have the properties
function changeFlashMovie(tagMovie,tagEmbed,strHeight,strWidth,strWmode,strPluginspage,strController,strType,strAutostart,strSRC)
{
	tagMovie.value = strSRC;
	tagEmbed.innerHTML = "<embed height=\"" + strHeight + "\" width=\"" + strWidth + "\" wmode=\"" + strWmode + "\" pluginspage=\"" + strPluginspage + "\" controller=\"" + strController + "\" type=\"" + strType + "\" autostart=\"" + strAutostart + "\" src=\"" + strSRC + "\"/>";
}//end of changeFlashMovie()

//changes two images are the beginning and end
function changeTwoImages(tagBeginImage,tagEndImage,strBeginImage,strEndImage)
{
	//gets the properties of the tags
	tagBeginImage = getDocID(tagBeginImage);
	tagEndImage = getDocID(tagEndImage);
	
	//checks if there is a tagTarget on the page
	if(tagBeginImage != null && tagEndImage != null)
	{
		//sets the style to be the new iamge
		if(strBeginImage != "" && strEndImage != "")
		{
			tagBeginImage.src = strBeginImage;
			tagEndImage.src = strEndImage;
		}//end of if
	}//end of if
}//end of changeTwoImages()

//changes the Text Header and the Image in order for Picture Gallery can display the image fully
function changeImageLightBox(tagImage,tagLightBoxTitle,strImage,strLightBoxTitle,tagTitleBar,strStyleName)
{
	//gets the properties of the tags
	tagImage = getDocID(tagImage);
	tagLightBoxTitle = getDocID(tagLightBoxTitle);
	tagTitleBar = getDocID(tagTitleBar);
	
	//checks if there is a LightBox Title to Change
	if(tagLightBoxTitle != null)
		tagLightBoxTitle.innerHTML = strLightBoxTitle;
		
	//checks if there is a tagTarget on the page
	if(tagImage != null)
	{
		//sets the style to be the new iamge
		if(strImage != "")
		{			
			tagImage.src = strImage;
						
			//checks if the width is bigger then height
			if(tagImage.width > tagImage.height)
				tagImage.width = 325;
			else
				tagImage.height = 325;	
		}//end of if
	}//end of if
	
	//checks if there is a TItle Bar to move in order for the Image to be as big as it wants to be
	if(tagTitleBar != null)
	{
		var intTitleBarStyle = 0;
		
		//checks if the form is IE or the other broswers this is to see if it is need to grow th size to
		//fit the boarder and removes the px at the end of the area
		if (tagTitleBar.currentStyle)
			//IE
			intTitleBarStyle = parseInt(tagTitleBar.currentStyle[strStyleName].substring(0,tagTitleBar.currentStyle[strStyleName].length - 2));
		else
			//other broswers
			intTitleBarStyle = parseInt(document.defaultView.getComputedStyle(tagTitleBar,null).getPropertyValue(strStyleName).substring(0,document.defaultView.getComputedStyle(tagTitleBar,null).getPropertyValue(strStyleName).length - 2));

		//checks if it is need size needs to grow
		if(tagImage.width > intTitleBarStyle)
			tagTitleBar.style.width = (tagImage.width) + "px";
		else
			//removes the style
			tagTitleBar.style.width = '';
	}//end of if
}//end of changeImageLightBox()

//chanages a class from a tag
function changeClass(tagLayer,strNewClassName)
{
	//gets the properties of tagImage
	tagLayer = getDocID(tagLayer);
	
	//checks if there is a properties
	if(tagLayer != null)
		tagLayer.className = strNewClassName;
}//end of changeClass

//changes the Div image of tagImage to what is in strImageSrc
function changeDivImage(tagImage,strImageSrc)
{
	//gets the properties of tagImage
	tagImage = getDocID(tagImage);
	
	//checks if there is a properties
	if(tagImage != null)
		tagImage.style.background = strImageSrc;
}//end of changeDivImage()

//changes the image of tagImage to what is in strImageSrc
function changeImage(tagImage,strImageSrc)
{
	//gets the properties of tagImage
	tagImage = getDocID(tagImage);
	
	//checks if there is a properties
	if(tagImage != null)
		tagImage.src = strImageSrc;
}//end of changeImage()

//changes the subject and message in a Email lightbox
function changeLBEmailText(tagSubject,tagMessage,strSubject,strMessage)
{
	//gets the properties of the tags
	tagSubject= getDocID(tagSubject);
	tagMessage = getDocID(tagMessage);
	
	//checks if there is a LightBox Title to Change
	if(tagSubject != null)
		tagSubject.value = strSubject;
	
	//checks if there is a LightBox Text to Change
	if(tagMessage != null)
		tagMessage.innerHTML = strMessage;
}//end of changeLBEmailText()

//changes the Text Header and the text in the body
function changeLBText(tagImage,tagLightBoxTitle,tagLightBoxText,strLightBoxTitle,strLightBoxText)
{
	//gets the properties of the tags
	tagLightBoxText = getDocID(tagLightBoxText);
	tagLightBoxTitle = getDocID(tagLightBoxTitle);
	
	//checks if there is a LightBox Title to Change
	if(tagLightBoxTitle != null)
		tagLightBoxTitle.innerHTML = strLightBoxTitle;
	
	//checks if there is a LightBox Text to Change
	if(tagLightBoxText != null)
		tagLightBoxTText.innerHTML = strLightBoxText;
}//end of changeLBText()

//checks the current language of the site base on what is being selected
function checkLanguage(tagContainer,strClassName,strTAGName)
{
	//gets the search bar properties
	var arrTAG = getDocID(tagContainer).getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	var strLang = "English";//holds the language

	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName
		if(arrTAG[intIndex].className == strClassName)
			//gets the language
   			strLang = arrTAG[intIndex].text;
	}//end of for loop
	
	return strLang;
}//end of checkLanguage()

//sets the size of the text for the body
function changeSize(strFileName,strSize)
{		
	var htmlJavaServerObject = getXMLHttpRequest();//holds the object of the server
	
	//Abort any currently active request.
	htmlJavaServerObject.abort();
		
	// Makes a request
 	htmlJavaServerObject.open("Post", strFileName, true);
	htmlJavaServerObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

	htmlJavaServerObject.onreadystatechange = function(){
    	if(htmlJavaServerObject.readyState == 4 && htmlJavaServerObject.status == 200)
		{
			//refeshes the page
			location.reload(true);
		}//end of if
		else if(htmlJavaServerObject.readyState == 2 && htmlJavaServerObject.status == 500)
		{
			//closes the pop up and removes the textbox so the user cannot use them again until they refresh the page
			alert('Unable to Connect to the Server');
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send("ChangeSize=" + encodeURL(strSize));

	return true;
}//end of changeSize()

//checks if the email is valid
function checkEmail(strEMail)
{
	var strFilter = /^.+@.+\..{2,3}$/;//holds the filtter for the Email

	//checks if there is E-Mail
	if (strEMail == "")
	{
		alert('You must have e-mail address');
		return false;
	}//end of if 

	//checks if there the E-Mail Format is current
	if (strFilter.test(strEMail) == false)
	{
		alert("The address " + strEMail + ". Please check the entry for 'Your e-mail address.'");
		return false;
	}//end of if
	else if (strEMail.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
	{
		alert('Your e-mail address contains illegal characters.');
		return false;
	}//end of else if

	return true;
}//end of checkEmail()

//removes from view all tags in tagContainer with the expection of tagActive but goes the other way from classToggleLayer
//It assumes the tagActive and tagContiner already have the properties
function classRevToggleLayer(tagContainer,tagActive,strClassName,strTAGName)
{
	var arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	
	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName and it is not active if it is active then change the dispaly to block
		if(arrTAG[intIndex].className == strClassName && arrTAG[intIndex].id != tagActive.id)
			arrTAG[intIndex].style.display = arrTAG[intIndex].style.display? "":"block";
		else if(arrTAG[intIndex].id == tagActive.id && tagActive.style.display == "")
			arrTAG[intIndex].style.display = arrTAG[intIndex].style.display? "":"";
	}//end of for loop
}//end of classRevToggleLayer()

//removes from view all tags in tagContainer with the expection of tagActive
//It assumes the tagActive and tagContiner already have the properties
function classToggleLayer(tagContainer,tagActive,strClassName,strTAGName)
{
	var arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	
	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName and it is not active if it is active then change the dispaly to block
		if(arrTAG[intIndex].className == strClassName && arrTAG[intIndex].id != tagActive.id)
			arrTAG[intIndex].style.display = arrTAG[intIndex].style.display? "":"";
		else if(arrTAG[intIndex].id == tagActive.id && tagActive.style.display == "")
			arrTAG[intIndex].style.display = arrTAG[intIndex].style.display? "":"block";
	}//end of for loop
}//end of classToggleLayer()

//removes from view all tags in tagContainer with the expection of tagActive and adds color if the user choose to
//It assumes the tagActive and tagContiner already have the properties
function classToggleLayerColor(tagContainer,tagActive,strClassName,strTAGName,strNonActiveColor,strActiveColor)
{
	var arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	
	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName
		if(arrTAG[intIndex].className == strClassName && arrTAG[intIndex].id != tagActive.id)
		{
			//if strNonActiveColor is blank then it will remove the style.color
			arrTAG[intIndex].style.color = strNonActiveColor;
		}//end of if
		else if(arrTAG[intIndex].id == tagActive.id && tagActive.style.display == "")
		{
			//checks if the user wants to change color of the strTAGName
			if(strActiveColor != "")
				arrTAG[intIndex].style.color = strActiveColor;
		}//end of if else
	}//end of for loop
}//end of classToggleLayerColor()

//removes from view all tags in tagContainer with the expection of tagActive
//It assumes the tagActive and tagContiner already have the properties
function classToggleLayerChangeClass(tagContainer,tagActive,strActiveClassName,strClassName,strTAGName)
{
	var arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	
	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if there is a class to use
		if(arrTAG[intIndex].className != "divSelectLevelImages" && arrTAG[intIndex].className != "divSecSelectLevelText")
		{
			//checks if the class name is the same as strClassName and it is not active if it is active then change the dispaly to block
			if(arrTAG[intIndex].id != tagActive.id)
				arrTAG[intIndex].className = strClassName;
			else if(arrTAG[intIndex].id == tagActive.id)
			{
				arrTAG[intIndex].className = strActiveClassName;
				
				//also removes the style as it is still on the block postion
				arrTAG[intIndex].style = "";
			}//end of else
		}//end of if
	}//end of for loop
}//end of classToggleLayerChangeClass()

//removes from view all tags in tagContainer with the expection of Image Active and adds the images to the non active image
//It assumes the tagActive and tagContiner already have the properties
function classToggleLayerImg(tagContainer,tagActive,strClassName,strTAGName,strActiveImg,strNonActiveImg)
{
	var arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	
	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName
		if(arrTAG[intIndex].className == strClassName && arrTAG[intIndex].id != tagActive.id)
			arrTAG[intIndex].src = strNonActiveImg;
		else if(arrTAG[intIndex].id == tagActive.id)
			arrTAG[intIndex].src = strActiveImg;
	}//end of for loop
}//end of classToggleLayerImg()

//removes from view all tags in tagContainer with the expection of tagActive and creates a link for the active and a label for the none 
//active also remove the old tag
//It assumes the tagActive and tagContiner already have the properties
function classToggleLayerTag(tagContainer,tagActive,strClassName,strTAGName,strName,strLink,strOnClick)
{
	var arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer
	
	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1; intIndex--)
	{		
		//checks if the class name is the same as strClassName and it is not active if it is active then change the dispaly to block
		if(arrTAG[intIndex].className == strClassName && arrTAG[intIndex].id != tagActive.id)
		{
			//remove the tag from arrTAG[intIndex}
			arrTAG[intIndex].removeChild(arrTAG[intIndex].childNodes[0]);
			
			//create link and for the nonActive
			createLink(tagContainer,strLink,strOnClick,strName,strClassName);
		}//end of if
		else if(arrTAG[intIndex].id == tagActive.id && tagActive.style.display == "")
			addNode(tagContainer.id,strName,false,true)
	}//end of for loop
}//end of classToggleLayerTag()

//clears the Text
function clearText(thefield)
{
	if (thefield.defaultValue == thefield.value)
		thefield.value = "";
}//end of clearText()

//sets up the basic Links since they are so many of them for Links ONLY
function createLink(tagTD,strLink,strOnClick,strNameTag,strClassName)
{
	//sets the Attributes for the tagA then adds it to the table
	tagA = document.createElement('a');//holds the Linking tag
	tagA.setAttribute('href',strLink);
	if (strClassName != '') tagA.setAttribute('class', strClassName);
	if (strOnClick != '') tagA.setAttribute('onclick',strOnClick);
	tagA.appendChild(document.createTextNode(strNameTag));
	tagTD.appendChild(tagA);
	
	return true;
}//end of createLink()

//decodes str to be a normal string in order to read it
function decodeURL(strDecode)
{
     return unescape(strDecode.replace(/\+/g, " "));
}//end of decodeURL()

//does the display the a message in a on the page weather then an alert
function displayMessage(tagMessage,strMessText,boolAddToBack, boolRemoveNode)
{
	//gets the message properties and sets the text furthermore it does the display
	tagMessage = addNode(tagMessage,strMessText,boolAddToBack, boolRemoveNode);
	tagMessage.style.display = "block";	
	
	return tagMessage;
}//end of displayMessage()

//this is for the duel layers that sometimes is need
function duelToggleLayer(whichLayer,layer1,layer2)
{
	var activeLayer = "";//holds the active Layer	
	var style2 = "";//holds the style of layer1
	var style3 = "";//holds the style of layer2

	// this is the way the standards work
	if (whichLayer != ''){activeLayer = getDocID(whichLayer);}
	if (layer1 != ''){style2 = getDocID(layer1);}
	if (layer2 != ''){style3 = getDocID(layer2);}

	//Checks if there is an active layer
	if (activeLayer != "")
	{
		//checks if the activeLayer is already active and if so then skips code
		//since the layer cannot be turn off and leave a hole in the review layer
		if (activeLayer.style.display == "")
		{
			//removes the block from the display in order to make the layer to disapper	
			if (style2 != ''){style2.style.display = style2.style.display? "":"";}

			//checks if there is a style3
			if (style3 != ''){style3.style.display = style3.style.display? "":"";}
	
			//displays the new active Layer and updates its id
			activeLayer.style.display = activeLayer.style.display? "":"block";
		}//end of if
	}//end of if
}//end of duelToggleLayer()

//encodes str to a URL so it can be sent over the URL address
function encodeURL(strEncode)
{
	var strResult = "";
	
	for (intIndex = 0; intIndex < strEncode.length; intIndex++) {
		if (strEncode.charAt(intIndex) == " ") strResult += "+";
		else strResult += strEncode.charAt(intIndex);
	}
	
	return escape(strResult);
}//end of encodeURL()

//gives the user the message has been sent or not and changes the pop area
function endMessage(strEndMessage,strID,tagMessage,tagGrayOut,tagEMailBody)
{
	var tagPopUpArea = getDocID(strID);//holds the pop up area
	var arrActullyEndMassage = strEndMessage.split("</head>");//gets the acrtully end message because ASP.NET has alot of useless overhead
	
	//adds some text to the div tag and then displays it to the user
	displayMessage(tagMessage,arrActullyEndMassage[1],true,true);
	
	//adds in the new line
	tagPopUpArea.appendChild(document.createElement('br'));
	
	//checks if there is the finction was called by the Contact form which does not have a CSS Pop-Up Window
	if (strID != "")
	{
		var tagDIV = document.createElement('div');//holds the DIV tag
		
		//holds the real time div and give its name and align and the link that will close the pop up
		tagDIV.setAttribute('id', "divClose" + strID);
		tagDIV.setAttribute('align', "center");
		tagPopUpArea.appendChild(tagDIV);
	}//end of if
}//end of endMessage()

//gets the document properties in order to use them as there are many types of browers with different versions
function getDocID(tagLayer)
{
	var tagProp = "";//holds the proerties of tagLayer

	//gets the whichLayer Properties depending of the differnt bowers the user is using
	if (document.getElementById)//this is the way the standards work
		tagProp = document.getElementById(tagLayer);
	else if (document.all)//this is the way old msie versions work
		tagProp = document.all[tagLayer];
	else if (document.layers)//this is the way nn4 works
		tagProp = document.layers[tagLayer];
		
	return tagProp;
}//end of getDocID()

//gets the full URL encodes it for HTML
function getURL(tagLink)
{
	return encodeURL(document.location.href);
}//end of getURL()

//Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
    var vars = [], hash;//holds the valuable value from the URL
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');//holds the section of of the value and valuable

	//goes around for each valuable in the URL
    for(var i = 0; i < hashes.length; i++)
    {
		//splites the value and valuable into half
        hash = hashes[i].split('=');
		
		//adds the valuable into first part ant the value into the secound pard
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }//end of for loop

    return vars;
}//end of getUrlVars()

//does a group tigger that hides or displays tags
function groupToggleLayer(tagUpperPrice,tagRecommend,tagLine,boolIsShowing)
{
	//gets the properties
	tagUpperPrice = getDocID(tagUpperPrice);
	tagRecommend = getDocID(tagRecommend);
	tagLine = getDocID(tagLine);
	
	if (tagUpperPrice != null && boolIsShowing == false)
		tagUpperPrice.style.display = "none";
	else if(tagUpperPrice != null && boolIsShowing == true)
		tagUpperPrice.style.display = "";
		
	if (tagRecommend != null && boolIsShowing == false)
		tagRecommend.style.display = "none";
	else if(tagRecommend != null && boolIsShowing == true)
		tagRecommend.style.display = "";
		
	if (tagLine != null && boolIsShowing == false)
		tagLine.style.display = "none";
	else if(tagLine != null && boolIsShowing == true)
		tagLine.style.display = "";    
}//end of groupToggleLayer()

//Changes the layers of the information section of item detail
function infoDetailLayer(whichLayer,layer1,layer2,layer3)
{
	var activeLayer = "";//holds the active Layer	
	var style2 = "";//holds the style of layer1
	var style3 = "";//holds the style of layer2
	var style4 = "";//holds the style of layer3

	// this is the way the standards work
	if (whichLayer != ''){activeLayer = getDocID(whichLayer);}
	if (layer1 != ''){style2 = getDocID(layer1);}
	if (layer2 != ''){style3 = getDocID(layer2);}
	if (layer3 != ''){style4 = getDocID(layer3);}

	//Checks if there is an active layer
	if (activeLayer != "" && activeLayer != null)
	{
		//checks if the activeLayer is already active and if so then skips code
		//since the layer cannot be turn off and leave a hole in the review layer
		if (activeLayer.style.display == "")
		{
			//removes the block from the display in order to make the layer to disapper	
			if (style2 != '')
				style2.style.display = style2.style.display? "":"";

			//checks if there is a style3
			if (style3 != '')
				style3.style.display = style3.style.display? "":"";
				
			//checks if there is a style3
			if (style4 != '')
				style4.style.display = style4.style.display? "":"";
	
			//displays the new active Layer and updates its id
			activeLayer.style.display = activeLayer.style.display? "":"block";
		}//end of if
	}//end of if
}//end of infoDetailLayer()

//removes all new lines and replaces them with a <br/> html tag
function nl2br(strText)
{
	//checks if there is anything inside strText
	if (strText != "")
	{
 		var re_nlchar = "";//holds the different newlines that the OS uses
		strText = escape(strText);//in codes strText to be more like a URL to find the newlines
			
		//finds the either \r or \n or both since \r is for Linex and Apple and \n is for MS
		if(strText.indexOf('%0D%0A') > -1)
			re_nlchar = /%0D%0A/g ;
		else if(strText.indexOf('%0A') > -1)
			re_nlchar = /%0A/g ;
		else if(strText.indexOf('%0D') > -1)
			re_nlchar = /%0D/g ;
	
		//checks if there is any new lines in strText
		if (re_nlchar != "")
			//changes the strText back to normal with all of the newlines changes to <br/> tag
			return unescape(strText.replace(re_nlchar,'<br />'));
	}//end of if
	
	return strText;
}//end of nl2br()

//creates a pop up window
function popUpWindow(strURL) 
{
	newwindow=window.open(strURL,'name','height=996,width=996,scrollbars=yes');//
	if (window.focus) {newwindow.focus()}
	return false;
}//end of popUpWindow()

//set up the form to not be used while sending the message
function preSendEMail(tagMessage,tagEMailBody)
{
	//display to the user their message is beening sent and disables the textbox area
	displayMessage(tagMessage,'Sending Message...',true,true);
	tagEMailBody.style.display = 'none';
}//end of preSendEMail()

//rejects 2 tags to mach one another hieght wiase
function rejustHeight(tagCotentHolder,tagActionLinkHolder)
{
	//check if action already has a hieght and if so then removes it
	if(getDocID(tagActionLinkHolder).style.height != "") 
		getDocID(tagActionLinkHolder).style.height = "";
	
	//checks if tagContentHolder the one with all of the content of the Product is
	//longer then the action link holder and if so then do the funciton
	//to make them equal
	if(getDocID(tagCotentHolder).offsetHeight > 716)
		//makes sure that both the div for the action and the div for the content are equal
		P7_equalCols2(0,tagCotentHolder,'label',tagActionLinkHolder,'div');
	else
		//floors the height to a min amount
		getDocID(tagActionLinkHolder).style.height = "716px";
}//end of rejustHeight()

//removes all contorls from tagContent
function removeAll(tagContent)
{
	tagContent = getDocID(tagContent);//holds the Content that 
		
	if (tagContent != null)
	{		
		for(var intIndex = 0; intIndex < tagContent.childNodes.length; intIndex++)
		{
			tagContent.removeChild(tagContent.childNodes[intIndex]);
		}//end of for loop
		
	}//end of if	
}//end of removeAll()

//resets teh Care To Share area
function resetCare(tagVoteBody,tagThankYou,tagThankYouBody,tagVoteMainBody,tagVoteMessage,tagVoteThankYouMessage)
{
	//takes the user to the thank you section
	tagVoteBody.style.display = "block";
	tagVoteMainBody.style.display = "block";
	tagThankYou.style.display = "";
	tagThankYouBody.style.display = "";
	tagVoteMessage.style.display = "";
	tagVoteThankYouMessage.style.display = "";
}//end of resetCate()

//does the search bar onForcus Event
function searchBarForce(tagContainer,strClassName,strTAGName,strColor,strValue)
{
	//gets the search bar properties
	var arrTAG = getDocID(tagContainer).getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer

	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName
		if(arrTAG[intIndex].className == strClassName)
		{
			//changes the color and text to blank when the user frocus on the textbox
		    arrTAG[intIndex].style.color = strColor;
    		arrTAG[intIndex].value = strValue;
		}//end of if
	}//end of for loop
}//end of searchBarForce()

//does the search bar onblur Event(focus off)
function searchBarFocusOff(tagContainer,strClassName,strTAGName)
{
	//gets the search bar properties
	var arrTAG = getDocID(tagContainer).getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer

	//goes around the for each tag that getElementsByTagName found in tagContainter
	for(var intIndex = arrTAG.length - 1; intIndex > -1 ; intIndex--) 
	{
		//checks if the class name is the same as strClassName
		if(arrTAG[intIndex].className == strClassName)
		{
			if(arrTAG[intIndex].value=="")
			{
				//changes the color and text when the user leave the textbox
	    		arrTAG[intIndex].style.color = "#C0c0c0";
   				arrTAG[intIndex].value = " title/series/ISBN/author";
			}//end of if	
		}//end of if
	}//end of for loop
}//end of searchBarFocusOff()

//sends an email to a Friend of the user who ment what a Product
function sendShareEMail(strFileName,tagGrayOut,tagMessage,strPopUpID,tagEMailBody,tagName,tagSendTo,tagEMail,tagComm,strProductName,strProductNameURL)
{		
	var strFilter = /^.+@.+\..{2,3}$/;//holds the filtter for the Email
	var htmlJavaServerObject = getXMLHttpRequest();//holds the object of the server
	var arrSendTo = tagSendTo.value.split(';');//holds all of the e-mail address that are going to be sent out

	//checks if they have a E-Mail
	if (tagSendTo.value=="")
  		{displayMessage(tagMessage,'You must have e-mail address, that you are sending to',true,true);
			return false;}
		
	//goes around each e-mail the user entered
	for(var intIndex = arrSendTo.length - 1; intIndex > -1;intIndex--)
	{
		//checks if there the E-Mail Format is current
		if (strFilter.test(arrSendTo[intIndex]) == false)
  			{displayMessage(tagMessage,"Please input Valid e-mail address for " + arrSendTo[intIndex],true,true);
				return false;}
		else if (arrSendTo[intIndex].match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  			{displayMessage(tagMessage,"The e-mail address, " + arrSendTo[intIndex]  + ", that you are sending to, contains illegal Characters.",true,true);
				return false;}
	}//end of for loop

	//checks if there is a Name
	if (tagName.value=="")
  		{displayMessage(tagMessage,'You must have a name entered',true,true);
			return false;}
				
	//checks if there is E-Mail
	if (tagEMail.value=="")
  		{displayMessage(tagMessage,'You must have e-mail address',true,true);
			return false;}	
			
	//checks if there the E-Mail Format is current
	if (strFilter.test(tagEMail.value) == false)
  		{displayMessage(tagMessage,'Please input valid e-mail address, for yourself!',true,true);
			return false;}
	else if (tagEMail.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagMessage,'Your e-mail address contains illegal characters.',true,true);
			return false;}
		
	//Abort any currently active request.
	htmlJavaServerObject.abort();
	
	//prepers the form for sending a e-mail
	preSendEMail(tagMessage,tagEMailBody);
	
	// Makes a request
 	htmlJavaServerObject.open("Post", strFileName, true);
	htmlJavaServerObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

	htmlJavaServerObject.onreadystatechange = function(){
    	if(htmlJavaServerObject.readyState == 4 && htmlJavaServerObject.status == 200)
		{
			//closes the pop up and removes the textbox so the user cannot use them again until they refresh the page
			endMessage(htmlJavaServerObject.responseText,strPopUpID,tagMessage,tagGrayOut,tagEMailBody);
							
			//resets the fields and disables the field area
            tagSendTo.value = "";
			tagName.value = "";
			tagEMail.value = "";
			tagComm.value = "";
			
			//means dispapire
			tagEMailBody.style.display = "";
		}//end of if
		else if(htmlJavaServerObject.readyState == 2 && htmlJavaServerObject.status == 500)
		{
			//closes the pop up and removes the textbox so the user cannot use them again until they refresh the page
			endMessage('<head></head>Unable to Connect to the Server.</head>',strPopUpID,tagMessage,tagGrayOut,tagEMailBody);
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send("txtName=" + encodeURL(tagName.value) + "&txtFromEMail=" + encodeURL(tagEMail.value) + "&txtComm=" + encodeURL(nl2br(tagComm.value)) + "&txtSendTo=" + encodeURL(tagSendTo.value) + "&ProductName=" + encodeURL(strProductName) + "&ProductNameURL=" + encodeURL(strProductNameURL));
			
	return true;
}//end of sendShareEMail()

//sends an email to a Friend of the user for Care to Share
function sendShareCareEMail(strFileName,tagMessage,tagErrorMessage,tagBody,tagName,tagEMail,tagEMail1,tagEMail2,tagEMail3,tagEMail4,tagEMail5,tagEMail6,tagEMail7,tagEMail8,tagEMail9,tagEMail10)
{		
	var strFilter = /^.+@.+\..{2,3}$/;//holds the filtter for the Email
	var htmlJavaServerObject = getXMLHttpRequest();//holds the object of the server
				
	//checks if there is E-Mail
	if (tagName.value=="")
  		{displayMessage(tagErrorMessage,'You must have a name',true,true);
			return false;}	
			
	//checks if there is E-Mail
	if (tagEMail.value=="")
  		{displayMessage(tagErrorMessage,'You must have e-mail address',true,true);
			return false;}	
			
	//checks if there the E-Mail Format is current
	if (strFilter.test(tagEMail.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for yourself!',true,true);
			return false;}
	else if (tagEMail.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Your e-mail address contains illegal characters.',true,true);
			return false;}
			
	//checks if there is E-Mail
	if (tagEMail1.value=="")
  		{displayMessage(tagErrorMessage,'You must have at last one friend e-mail address',true,true);
			return false;}	
			
	//checks if there the E-Mail Format is current
	if (strFilter.test(tagEMail1.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 1',true,true);
			return false;}
	else if (tagEMail1.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 1 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail2.value!="" && strFilter.test(tagEMail2.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 2',true,true);
			return false;}
	else if (tagEMail2.value!="" && tagEMail2.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 2 contains illegal characters.',true,true);
			return false;}
			
		//checks if there the E-Mail Format is current
	if (tagEMail3.value!="" && strFilter.test(tagEMail3.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 3',true,true);
			return false;}
	else if (tagEMail3.value!="" && tagEMail3.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 3 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail4.value!="" && strFilter.test(tagEMail4.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 4',true,true);
			return false;}
	else if (tagEMail4.value!="" && tagEMail4.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 4 contains illegal characters.',true,true);
			return false;}
						
	//checks if there the E-Mail Format is current
	if (tagEMail5.value!="" && strFilter.test(tagEMail5.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 5',true,true);
			return false;}
	else if (tagEMail5.value!="" && tagEMail5.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 5 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail6.value!="" && strFilter.test(tagEMail6.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 6',true,true);
			return false;}
	else if (tagEMail6.value!="" && tagEMail6.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 6 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail7.value!="" && strFilter.test(tagEMail7.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 7',true,true);
			return false;}
	else if (tagEMail7.value!="" && tagEMail7.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 7 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail8.value!="" && strFilter.test(tagEMail8.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 8',true,true);
			return false;}
	else if (tagEMail8.value!="" && tagEMail8.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 8 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail9.value!="" && strFilter.test(tagEMail9.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 9',true,true);
			return false;}
	else if (tagEMail9.value!="" && tagEMail9.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 9 contains illegal characters.',true,true);
			return false;}
			
	//checks if there the E-Mail Format is current
	if (tagEMail10.value!="" && strFilter.test(tagEMail10.value) == false)
  		{displayMessage(tagErrorMessage,'Please input valid e-mail address, for Friend Email 10',true,true);
			return false;}
	else if (tagEMail10.value!="" && tagEMail10.value.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/))
  		{displayMessage(tagErrorMessage,'Friend Email 10 contains illegal characters.',true,true);
			return false;}
		
	//Abort any currently active request.
	htmlJavaServerObject.abort();
	
	//prepers the form for sending a e-mail
	preSendEMail(tagMessage,tagBody);
	
	// Makes a request
 	htmlJavaServerObject.open("Post", strFileName, true);
	htmlJavaServerObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

	htmlJavaServerObject.onreadystatechange = function(){
    	if(htmlJavaServerObject.readyState == 4 && htmlJavaServerObject.status == 200)
		{
			//closes the pop up and removes the textbox so the user cannot use them again until they refresh the page
			displayMessage(tagMessage,htmlJavaServerObject.responseText,true,true);
			
			//resets teh fields
			tagName.value = "";
			tagEMail.value = "";
			tagEMail1.value = "";
			tagEMail2.value = "";
			tagEMail3.value = "";
			tagEMail4.value = "";
			tagEMail5.value = "";
			tagEMail6.value = "";
			tagEMail7.value = "";
			tagEMail8.value = "";
			tagEMail9.value = "";
			tagEMail10.value = "";
		}//end of if
		else if(htmlJavaServerObject.readyState == 2 && htmlJavaServerObject.status == 500)
		{
			//closes the pop up and removes the textbox so the user cannot use them again until they refresh the page
			endMessage('<head></head>Unable to Connect to the Server.</head>',"",tagMessage,"","");
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send("txtName=" + encodeURL(tagName.value) + "&txtEMail=" + encodeURL(tagEMail.value) + "&txtEMail1=" + encodeURL(tagEMail1.value) + "&txtEMail2=" + encodeURL(tagEMail2.value) + "&txtEMail3=" + encodeURL(tagEMail3.value) + "&txtEMail4=" + encodeURL(tagEMail4.value) + "&txtEMail5=" + encodeURL(tagEMail5.value) + "&txtEMail6=" + encodeURL(tagEMail6.value) + "&txtEMail7=" + encodeURL(tagEMail7.value) + "&txtEMail8=" + encodeURL(tagEMail8.value) + "&txtEMail9=" + encodeURL(tagEMail9.value) + "&txtEMail10=" + encodeURL(tagEMail10.value));
			
	return true;
}//end of sendCareShareEMail()

//sends adds on to teh votes and send the your a thank massage
function sendVotes(strFileName,tagMessage,tagVoteBody,tagThankYouBody,tagVoteMainBody,tagVoteCounter)
{		
	var htmlJavaServerObject = getXMLHttpRequest();//holds the object of the server

	//Abort any currently active request.
	htmlJavaServerObject.abort();
	
	//prepers the form for sending a e-mail
	preSendEMail(tagMessage,tagVoteBody);
	
	// Makes a request
 	htmlJavaServerObject.open("Post", strFileName, true);
	htmlJavaServerObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

	htmlJavaServerObject.onreadystatechange = function(){
    	if(htmlJavaServerObject.readyState == 4 && htmlJavaServerObject.status == 200)
		{
			//checks if the user has alredy voted and if so then displays a different message on the to them
			if(htmlJavaServerObject.responseText == "You have already Voted.")
				getDocID('lblVoteThankYou').innerHTML = "You vote has been recorded. <br/><br/>However, you can still invite your friends to join the Share to Care campaign<br />You can send up to 10 friends and invitation. Just fill out the following <br />form and hit send.";
			else
				//changes the voting number
				tagVoteCounter.innerHTML = htmlJavaServerObject.responseText;
			
			//takes the user to the thank you section
			tagVoteBody.style.display = "";
			tagVoteMainBody.style.display = "";
			tagThankYouBody.style.display = "block";
			displayMessage(tagMessage,'',true,true);
		}//end of if
		else if(htmlJavaServerObject.readyState == 2 && htmlJavaServerObject.status == 500)
		{
			//closes the pop up and removes the textbox so the user cannot use them again until they refresh the page
			endMessage('<head></head>Unable to Connect to the Server.</head>',strPopUpID,tagMessage,tagGrayOut,tagEMailBody);
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send();
			
	return true;
}//end of sendVotes()

//starts up the page
//starts up the page
function startUp()
{
	var oldonload=window.onload;//holds any prevs onload function from the js file

	//gets the onload window event checks if there is a function that is already in there
	window.onload=function(){
		if(typeof(oldonload)=='function')
			oldonload();
			
		  //starts up the video for the homepage visit if the Start Up div is on the page
		  
		  var tagStartUp = getDocID('divStartUp');//holds divStartUp
		  var tagIE7StartUp = getDocID('divStartUpIE7');//holds StartUpIE7
			  
		  if(tagStartUp != null)
		  {
			tagGrayOut = getDocID("divGrayBG");
			
			if(tagGrayOut != null)
		  	{
				if(navigator.appVersion.indexOf('MSIE 7') != -1)
					 tagIE7StartUp.style.display = "block";
				else
					tagStartUp.style.display = "block";
					
				tagGrayOut.style.display = "block";
			}//end of if
		  }//end of if
			
		  //finds which browser the user is using for Firefox it is the defult
		  //for IE 
		  if (navigator.userAgent.indexOf('MSIE') != -1)
		  {
			  /*var tagDNNNAV = getDocID('dnn_dnnNAV_ctldnnNAVctr62');//holds dnn_dnnNAV_ctldnnNAVctr62
			  
			  if(tagDNNNAV != null)
				 tagDNNNAV.style.marginLeft = '20px';*/
				 
			  var tagSubPageBannerContainer = getDocID('divSubPageBannerContainer');//holds divSubPageBannerContainer
			  
			  if(tagSubPageBannerContainer != null)
				 tagSubPageBannerContainer.style.width = '998px';
				 
			  var tagTopNav = getDocID('topnav');//holds topnav
			  
			  if(tagTopNav != null)
				 tagTopNav.style.paddingBottom = '1px';
				 
		      var tagSearchBarNavigation = getDocID('divSearchBarNavigation');//holds divSearchBarNavigation
			  
			  if(tagSearchBarNavigation != null)
				 tagSearchBarNavigation.style.paddingTop = '1px';
				 
			  
			  if(navigator.appVersion.indexOf('MSIE 6') != -1)
			  {
				  var tagIE6Container = getDocID('divIE6Container');//holds the notifion to upgrade
			  
				  if(tagIE6Container != null)
					 tagIE6Container.style.display = 'block';
			  }//end of if
			 
			  if(navigator.appVersion.indexOf('MSIE 8') != -1)
			  {
				 /* var tagTest = getDocID('divTest');//holds divTest
			  
				  if(tagTest != null)
					 tagTest.style.width = '500px';*/
			  }//end of if	  
		  }//end of if
		  //for Safari and Mac
		  else if (navigator.userAgent.indexOf('Safari') !=-1 || navigator.platform.indexOf("Mac") > -1)
		  {
			  var tagStartUp = getDocID('ifStartUp');//holds the ifStartUp
			  
			 /* if(tagStartUp != null)
				 tagStartUp.className = "iFrameNoWidth";

			  var tagStartUpFR = getDocID('ifStartUpFR');//holds the ifStartUpFR

			  if(tagStartUpFR != null)
				 tagStartUpFR.className = "iFrameNoWidth";*/
			  
			  //for Firefox for the Mac
			  if (navigator.userAgent.indexOf('Firefox') !=-1)
			  {
			  }//end of if else	
		  }//end of if else
		  //for Firefox
		  else if (navigator.userAgent.indexOf('Firefox') !=-1)
		  {
		  }//end of if else*/
		  //for Opera
		  else if (navigator.userAgent.indexOf('Opera') !=-1)
		  {
		  }//end of if else
	}//end of window.onload=function()
}//end of startUp()

//shoes and hides a <div> using display:block/none from the CSS
function toggleLayer(tagLayer,tagGrayOut,tagMedia)
{
	var tagStyle = '';//holds the style of tagLayer

	//gets the tagLayer and tagGrayOut Properties
	tagStyle = getDocID(tagLayer);
	tagGrayOut = getDocID(tagGrayOut);
	tagMedia = getDocID(tagMedia);
		
	if (tagStyle != null)
	{tagStyle.style.display = tagStyle.style.display? "":"block";}
	
	if (tagMedia != null && document.getElementById("embed_url") != null)
		tagMedia.removeChild(document.getElementById("embed_url"));
	
	if (tagGrayOut != null)
	{
		tagGrayOut.style.display = tagGrayOut.style.display? "":"block";

		//for IE
		if (navigator.userAgent.indexOf('MSIE') != -1)
		{
			tagGrayOut.attachEvent('onclick',function () {
				toggleLayer(tagStyle.id,tagGrayOut.id)
								
				//checks if there is any Media to stop also pleace remove when REUSING THIS FUNCTION 
				if (tagMedia != null && document.getElementById("embed_url") != null)
					tagMedia.removeChild(document.getElementById("embed_url"));
			});
		}//end of if
		//for the other browsers
		else
		{
			tagGrayOut.addEventListener('click',function () {
				toggleLayer(tagStyle.id,tagGrayOut.id);
				
			if (tagMedia != null && document.getElementById("embed_url") != null)
				tagMedia.removeChild(document.getElementById("embed_url"));
			},false);
		}//end of else
	}//end of if
}//end of toggleLayer()

//shoes and hides a <div> using display:block/none from the CSS
function toggleLayerDisplayNone(tagLayer)
{
	var tagStyle = '';//holds the style of tagLayer

	//gets the tagLayer and tagGrayOut Properties
	tagStyle = getDocID(tagLayer);
	
	if (tagStyle != null){tagStyle.style.display = "none";}
}//end of toggleLayerDisplayNone()

/*kamila*/


function layerSetup(id,visibility){
if(document.getElementById){
this.obj = document.getElementById(id).style;
this.obj.visibility = visibility;
return this.obj;}
else if(document.all){
this.obj = document.all[id].style;
this.obj.visibility = visibility;
return this.obj;}
else if(document.layers){
this.obj = document.layers[id];
this.obj.visibility = visibility;
return this.obj;}
}
function visVisible(param){
new layerSetup(param,'visible');
}

function visHidden(param){
new layerSetup(param,'hidden');
}
