/*
	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;
}//end of getXMLHttpRequest()

//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 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 = 500;
				tagImage.height = 375;
			}//end of if
			else if(tagImage.height > 375)
				tagImage.height = 375;	
		}//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()

//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 classToggleLayer()

//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 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()

//sets up the basic inputs since they are so many of them for Textboxs and Hidden ONLY
function createInput(tagTD,strValue,strID,strNameTag,strReadOnly,intSize)
{
	var inpTag = document.createElement('input');//creates an element
	
	//sets the Attributes for the inpTag then adds it to the table
	inpTag.setAttribute('value', strValue);
	inpTag.setAttribute('id', strID);
	
	//checks if the Input is going to be hdden
	if (intSize != 0)
	{
		//sets the rest of the Textbox Attributes 
		//checks if strReadOnly is need
		if (strReadOnly != '')
		{
			//checks if the user is uing IE or another Browser
			if (navigator.userAgent.indexOf('MSIE') !=-1)
			{
				//checks to make sure that strReadOnly is 'true' meaing that it should be readonly
				if (strReadOnly == 'true')
					inpTag.setAttribute('readOnly', true);
			}//end of if
			else
				inpTag.setAttribute('readonly', strReadOnly);
		}//end of if
		
		inpTag.setAttribute('size', intSize);
		tagTD.appendChild(document.createTextNode(strNameTag));
	}//end of if
	else
		//sets the type for hidden
		inpTag.setAttribute('type', 'hidden');
		
	tagTD.appendChild(inpTag);
	
	return true;
}//end of createInput()

//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 != null)
		tagA.setAttribute('class', strClassName);
		
	if (strOnClick != null)
		tagA.setAttribute('onclick',strOnClick);
	
	tagA.appendChild(document.createTextNode(strNameTag));
	tagTD.appendChild(tagA);
	
	return true;
}//end of createLink()

//sets up the basic TextArea since they are so many of them for TextArea ONLY
function createTextArea(tagTD,strValue,strID,boolDisable,intCols,intRows)
{
	var rtxtTag = document.createElement('textarea');//holds teh textarea tag
	
	//sets the Attributes for the rtxtTag then adds it to the table
	rtxtTag.value = strValue;
	rtxtTag.disabled = boolDisable;
	rtxtTag.id = strID;
	rtxtTag.cols = intCols;
	rtxtTag.rows = intRows;
	tagTD.appendChild(rtxtTag);
		
	return true
}//end of createTextArea()

//decodes str to be a normal string in order to read it
function decodeURL(strDecode)
{
     return unescape(strDecode.replace(/\+/g, " "));
}//end of decodeURL()

//deletes a row from a table
function deleteFromTable(strFileName,tagMessage,strTable,strIDField,strID,strItemToDelete,tagLayer,tagGrayOut)
{				
	var htmlJavaServerObject = getXMLHttpRequest();//holds the object of the server

	//checks if the user really wnats to delete this item
	if(confirm("Do You Wish To Delete This " + strItemToDelete + "?") == false)
		return false;

	//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)
		{
			var arrActullyEndMassage = htmlJavaServerObject.responseText.split("</head>");//gets the acrtully end message because ASP.NET has alot of useless overhead

			displayMessage(tagMessage,arrActullyEndMassage[1],true,true);
			toggleLayer(tagLayer,tagGrayOut,"");
		}//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
			displayMessage(tagMessage,'Unable to Connect to the Server.',true,true);
			toggleLayer(tagLayer,tagGrayOut,"");
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send("strTable=" + encodeURL(strTable) + "&strFieldID=" + encodeURL(strIDField) + "&strID=" + encodeURL(strID) + "&strItem=" +encodeURL(strItemToDelete));

	return true;
}//end of deleteFromTable()

//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()

//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);
	}//end of for loop
	
	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 document properties in order to use them as there are many types of browers with different versions by the Name
function getDocName(tagLayer)
{
	var tagProp = "";//holds the proerties of tagLayer

	tagProp = document.getElementsByName(tagLayer);
		
	return tagProp;
}//end of getDocName()

//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()

//set up the form to not be used while sending the message
function preSendToServer(tagMessage,tagLightBoxBody,strMessage)
{
	//display to the user their message is beening sent and disables the textbox area
	displayMessage(tagMessage,strMessage,true,true);
	tagLightBoxBody.style.display = 'none';
}//end of preSendToServer()

//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()

//dyamiclly change Lightbox Content
function reloadLightBoxBody(strLightBoxBody,strLightBoxTitle,tagLightBoxBody,tagLightBoxTitle,strFileName,strTableName,strFieldNameID,strID,strReturnFieldName)
{
	var htmlJavaServerObject = getXMLHttpRequest();//holds the object of the server

	//gets the proeprties of the tags	
    tagLightBoxBody = getDocID(tagLightBoxBody);
	tagLightBoxTitle = getDocID(tagLightBoxTitle);
	
    if(tagLightBoxBody != null)
	    tagLightBoxBody.innerHTML = strLightBoxBody + "<div align=\"center\"><label class=\"lblFontColorRed\">Loading Data...</label></div>";
	
	if(tagLightBoxTitle != null)
	    tagLightBoxTitle.innerHTML = strLightBoxTitle;
				
	//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)
		{
			if(tagLightBoxBody != null)
			{
				//remoces the Loading text from tagLightBoxBody
				//for IE 
				if (navigator.userAgent.indexOf('MSIE') != -1)
					tagLightBoxBody.innerHTML = tagLightBoxBody.innerHTML.replace("<DIV align=center><LABEL class=lblFontColorRed>Loading Data...</LABEL></DIV>", "");
				else
					tagLightBoxBody.innerHTML = tagLightBoxBody.innerHTML.replace("<div align=\"center\"><label class=\"lblFontColorRed\">Loading Data...</label></div>", "");
				
				//adds the data from the database to the page
				tagLightBoxBody.innerHTML += htmlJavaServerObject.responseText;
			}//end of if
		}//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
			if(tagLightBoxBody != null)
			{
				//remoces the Loading text from tagLightBoxBody
				//for IE 
				if (navigator.userAgent.indexOf('MSIE') != -1)
					tagLightBoxBody.innerHTML = tagLightBoxBody.innerHTML.replace("<DIV align=center><LABEL class=lblFontColorRed>Loading Data...</LABEL></DIV>", "");
				else
					tagLightBoxBody.innerHTML = tagLightBoxBody.innerHTML.replace("<div align=\"center\"><label class=\"lblFontColorRed\">Loading Data...</label></div>", "");

				//tells the user that there is a problem
				tagLightBoxBody.innerHTML += '<label>Unable to Connect to the Server.<label>';
			}//end of if
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send("tableName=" + encodeURL(strTableName) + "&fieldNameID=" + encodeURL(strFieldNameID) + "&returnFieldName=" + encodeURL(strReturnFieldName) + "&ID=" + encodeURL(strID));
	
	return true;
}//end of reloadLightBoxBody()

//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()

//removes content from a LightBox
function removeLightBoxBody(tagLightBoxBodyFile)
{	
	if(tagLightBoxBodyFile == null)
		tagLightBoxBodyFile = "divLightBoxBody";

    var tagLightBoxBodyFile = getDocID(tagLightBoxBodyFile);
	
    if(tagLightBoxBodyFile != null)	
	    tagLightBoxBodyFile.innerHTML = '';
}//end of removeLightBoxBody()

//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
	preSendToServer(tagMessage,tagEMailBody,'Sending Message...');
	
	// 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()

//set an event for tagEvent
//THIS CAN BE FOR ANY EVENT PLEASE CUSTOM THE PREMATIES IN ORDER TO REUSE THIS FUNXTION
function setEvent(tagEvent,intMaxItems,boolIsPlus,strEvent,strIEEvent,intImageIndex)
{
	//gets the tagEvent Properties
	tagEvent = getDocID(tagEvent);
	
	if (tagEvent != null)
	{
		//for IE
		if (navigator.userAgent.indexOf('MSIE') != -1)
		{			
			tagEvent.attachEvent(strIEEvent,function () {				
				//removes the event in order to set an new event
				getDocID('aLeftArrow').detachEvent(strIEEvent,arguments.callee);
				getDocID('aRightArrow').detachEvent(strIEEvent,arguments.callee);
				
				document.getElementById("aLeftArrow").onclick = null;
				document.getElementById("aRightArrow").onclick = null;

				//checks if boolIsPlus is true mean next has been press
				if(boolIsPlus == true)
				{
					//goes around for each image untill it finds the an tagImage to use
					for(intIndex = intImageIndex;intIndex <= intMaxItems;intIndex++)
					{
						tagImage = getDocID("image" + intIndex);
	
						if (tagImage != null)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image" + intIndex).src,'','','');
							
							//removes the event in order to set an new event
							getDocID('aLeftArrow').detachEvent(strIEEvent,arguments.callee);
							getDocID('aRightArrow').detachEvent(strIEEvent,arguments.callee);
							
							setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,(intIndex - 1));
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,(intIndex + 1));
						}//end of if
						//checks if this is the last of the images and if so then loop to the start
						else if(intIndex == intImageIndex)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image1").src,'','','');

							//removes the event in order to set an new event
							getDocID('aLeftArrow').detachEvent(strIEEvent,arguments.callee);
							getDocID('aRightArrow').detachEvent(strIEEvent,arguments.callee);
							
							setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,intMaxItems);
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,2);
						}//end of else if
						
						//leaves the loop if an image is found
						if (tagImage != null)
							break;
					}//end of for loop					
				}//end of if
				else
				{
					//goes around for each image untill it finds the an tagImage to use
					for(intIndex = intImageIndex;intIndex >= 1;intIndex--)
					{
						tagImage = getDocID("image" + intIndex);

						if (tagImage != null)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image" + intIndex).src,'','','');

							//removes the event in order to set an new event
							getDocID('aLeftArrow').detachEvent(strIEEvent,arguments.callee);
							getDocID('aRightArrow').detachEvent(strIEEvent,arguments.callee);
							
							//checks if intIndex is 1 meaning it is at the start and it should start from
							//the end if the click on aLeftArrow
							if(intIndex > 1)
								setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,(intIndex - 1));
							else
								setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,intMaxItems);

							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,(intIndex + 1));
						}//end of if
						//checks if this is the last of the images and if so then loop to the start
						else if(intIndex == 1)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image1").src,'','','');
							
							//removes the event in order to set an new event
							getDocID('aLeftArrow').detachEvent(strIEEvent,arguments.callee);
							getDocID('aRightArrow').detachEvent(strIEEvent,arguments.callee);
							
							setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,intMaxItems);
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,2);
						}//end of else if
						
						//leaves the loop if an image is found
						if (tagImage != null)
							break;
					}//end of for loop
				}//end of if
			});
		}//end of if
		//for the other browsers
		else
		{
			tagEvent.addEventListener(strEvent,function () {
				//removes the event in order to set an new event
				getDocID('aLeftArrow').removeEventListener(strEvent,arguments.callee,false);
				getDocID('aRightArrow').removeEventListener(strEvent,arguments.callee,false);
							
				//checks if boolIsPlus is true mean next has been press
				if(boolIsPlus == true)
				{
					//goes around for each image untill it finds the an tagImage to use
					for(intIndex = intImageIndex;intIndex <= intMaxItems;intIndex++)
					{
						tagImage = getDocID("image" + intIndex);
	
						if (tagImage != null)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image" + intIndex).src,'','','');

							setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,(intIndex - 1));
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,(intIndex + 1));
						}//end of if
						//checks if this is the last of the images and if so then loop to the start
						else if(intIndex == intImageIndex)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image1").src,'','','');
														
							setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,intMaxItems);
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,2);
						}//end of else if
						
						//leaves the loop if an image is found
						if (tagImage != null)
							break;
					}//end of for loop					
				}//end of if
				else
				{
					//goes around for each image untill it finds the an tagImage to use
					for(intIndex = intImageIndex;intIndex >= 1;intIndex--)
					{
						tagImage = getDocID("image" + intIndex);
	
						if (tagImage != null)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image" + intIndex).src,'','','');
							
							//checks if intIndex is 1 meaning it is at the start and it should start from
							//the end if the click on aRightArrow
							if(intIndex > 1)
								setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,(intIndex - 1));
							else
								setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,intMaxItems);
							
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,(intIndex + 1));
						}//end of if
						//checks if this is the last of the images and if so then loop to the start
						else if(intIndex == 1)
						{
							changeImageLightBox('imgHiddenPic','',getDocID("image1").src,'','','');

							setEvent('aLeftArrow',intMaxItems,false,strEvent,strIEEvent,intMaxItems);
							setEvent('aRightArrow',intMaxItems,true,strEvent,strIEEvent,2);
						}//end of else if
						
						//leaves the loop if an image is found
						if (tagImage != null)
							break;
					}//end of for loop
				}//end of if
			},false);
		}//end of else
	}//end of if
}//end of setEvent()

//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();
															
		//finds which browser the user is using for Firefox it is the defult
		//for IE 
		if (navigator.userAgent.indexOf('MSIE') != -1)
		{					
			//checks if IE is 7 as IE 8 is more standards compliated
			if(navigator.appVersion.indexOf('MSIE 7') != -1)
			{
				var tagFormSelect = getDocID('FormSelect');//the Form Select
				
				//checks if there the page is in the Product Details
				if(tagFormSelect != null)
				{
					tagFormSelect.style.padding = "8px 0 0 37px";
				}//end of if
			}//end of if
			
			if(navigator.appVersion.indexOf('MSIE 6') != -1)
			{
				var tagFormSelect = getDocID('FormSelect');//the Form Select
				var tagMainLeft = getDocID('divIE6Content');//the mainLeft in the details page
				
				//checks if there the page is in the Product Details
				if(tagMainLeft != null)
				{
					tagMainLeft.width = "1000px";
					//tagMainLeft.padding = "0 1px 0 0";
				}//end of if
				
				//checks if there the page is in the Product Details
				if(tagFormSelect != null)
				{
					tagFormSelect.style.padding = "0 0 0 37px";
					tagFormSelect.style.minHeight = "20px";
				}//end of if
			}//end of if
		}//end of if
		//for Safari and Mac
		else if (navigator.userAgent.indexOf('Safari') !=-1 || navigator.platform.indexOf("Mac") > -1)
		{
			var tagLocationsLeft = getDocID('locationsLeft');//the locations left
			var tagLocationsRight = getDocID('locationsRight');//the locations right
				
			//checks if there the page is in the Product Details
			if(tagLocationsLeft != null)
			{
				tagLocationsLeft.style.width = "575px";
				tagLocationsRight.style.width = "200px";
			}//end of if
		}//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 (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)
				
				//specal case pleace remove when REUSING THIS FUNCTION UNLESS YOU ARE USING IT Email TO A FRIEND
				infoDetailLayer('divShareFriendsBody','divShareMessage','','');
				infoDetailLayer('divRatingBody','divRatingMessage','','');
				removeLightBoxBody('divHiddenCityDetails');
				removeLightBoxBody('divHiddenDescription');
				
				//checks if it an item needs to close and reload the page as some of the pages use HTML to change the look of the Lightbox but ASP.NET's viewstate changes to much for Postback to work
				if(getDocID('divSearchCityDetails') != null || getDocID('divHiddenMap') != null || getDocID('divHiddenSearchMap') != null || getDocID('divResBox') != null|| getDocID('divDel') != null)
				{
					window.location.reload();
				}//end of if
								
				//checks if there is any Media to stop also pleace remove when REUSING THIS FUNCTION 
				if (tagMedia != null)
					tagMedia.Stop();
			});
		}//end of if
		//for the other browsers
		else
		{
			tagGrayOut.addEventListener('click',function () {

				//specal case pleace remove when REUSING THIS FUNCTION UNLESS YOU ARE USING IT Email TO A FRIEND
				infoDetailLayer('divShareFriendsBody','divShareMessage','','');
				infoDetailLayer('divRatingBody','divRatingMessage','','');
				removeLightBoxBody('divHiddenCityDetails');
				removeLightBoxBody('divHiddenDescription');
				
				//checks if it an item needs to close and reload the page as some of the pages use HTML to change the look of the Lightbox but ASP.NET's viewstate changes to much for Postback to work
				if(getDocID('divSearchCityDetails') != null || getDocID('divHiddenMap') != null || getDocID('divHiddenSearchMap') != null || getDocID('divResBox') != null|| getDocID('divDel') != null)
				{
					window.location.reload();
				}//end of if
				
				toggleLayer(tagStyle.id,tagGrayOut.id);
			},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()

//updates the Helpful area in Vistor Table in order to tell if the users like this review
function updateHelpful(strFileName,tagMessage,strHelpful,strVID,tagYesNoArea,tagFeedbackMessage)
{				
	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)
		{
			var arrActullyEndMassage = htmlJavaServerObject.responseText.split("</head>");//gets the acrtully end message because ASP.NET has alot of useless overhead

			//checks if there was any errors in UpdateHelpful if not then Display an error
			/*if(arrActullyEndMassage[1] == "")
			{*/
				//means disppears the yes and not section and display a message to the user
				tagYesNoArea.style.display = "none";
				tagFeedbackMessage.style.display = "block";
			/*}//end of if
			else
				displayMessage(tagMessage,"Error in Updating Database" + arrActullyEndMassage[1],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
			displayMessage(tagMessage,'Unable to Connect to the Server.',true,true);
		}//end of else if
	}//end of function()
	
	htmlJavaServerObject.send("strHelpful=" + encodeURL(strHelpful) + "&strVID=" + encodeURL(strVID));

	return true;
}//end of updatehelpful()

//validates if there is a value in a radio button
//has to uses the displayMessage as it also gets the value
function validateRadio(tagRate,tagMessage,strErrorMessage,boolAddToBack, boolRemoveNode)
{
	var intRating = 0;//holds the current rating
		
	//Goes around checking each radio button
	for (intIndex = 0; intIndex < tagRate.length; intIndex++)
	{
		//checks if any of the radio box have been click
		if (tagRate[intIndex].checked == true)
			intRating = intIndex + 1; 
	}//end of for loop

	//checks if there is a rating
	if (intRating==0)
		displayMessage(tagMessage,strErrorMessage,boolAddToBack, boolRemoveNode);
	
	return intRating;
}//end of validateRadio()

//checks if the link is valed
function validateLinks(tagLink,tagMessage)
{
	var tagLink = getDocID(tagLink);//holds the text box Link
	
	//checks if the link is current and if the format is current
	if (tagLink.value==""||tagLink.value=="http://"){
		displayMessage(tagMessage,'Invalidted Link',true,true);
		return false;
	}//end of if
		
	//opens a window for the user in order for them to check if the link works
	window.open(tagLink.value);

	return true;
}//end of validateLinks()

//checks if the count of the text in the textarea is in the limits of the maxlength
function validateTextAreaCount(text,long,tagMessage,strMessage)
{
	var maxlength = new Number(long);//Change number to your max length.

	if (text.value.length > maxlength)
	{
		text.value = text.value.substring(0,maxlength);
		displayMessage(tagMessage,"Only " + long + " characters for " + strMessage,true,true);
	}//end of if
}//end of validateTextAreaCount()

/* 
  ------------------------------------------------
  PVII Equal CSS Columns scripts -Version 2
  Copyright (c) 2005 Project Seven Development
  www.projectseven.com
  Version: 2.1.0
  ------------------------------------------------
*/
function P7_colH2(){ //v2.1.0 by PVII-www.projectseven.com
 var i,oh,h=0,tg,el,np,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
 for(i=1;i<dA.length;i+=2){dA[i+1].style.paddingBottom='';}for(i=1;i<dA.length;i+=2){
 oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=1;i<dA.length;i+=2){oh=dA[i].offsetHeight;
 if(oh<h){np=h-oh;if(!an&&dA[0]==1){P7_eqA2(dA[i+1].id,0,np);}else{
 dA[i+1].style.paddingBottom=np+"px";}}}document.p7eqa=1;
 document.p7eqth=document.body.offsetHeight;
 document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT2(){ //v2.1.0 by PVII-www.projectseven.com
 if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){P7_colH2();}
}
function P7_equalCols2(){ //v2.1.0 by PVII-www.projectseven.com

    var c,e,el;if(document.getElementById){document.p7eqc=new Array();
    document.p7eqc[0]=arguments[0];for(i=1;i<arguments.length;i+=2){el=null;
    c=document.getElementById(arguments[i]);if(c){e=c.getElementsByTagName(arguments[i+1]);
    if(e){el=e[e.length-1];if(!el.id){el.id="p7eq"+i;}}}if(c&&el){
    document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el}}
    setInterval("P7_eqT2()",10);}
   
    
}
function P7_eqA2(el,p,pt){ //v2.1.0 by PVII-www.projectseven.com
 var sp=10,inc=20,g=document.getElementById(el);np=(p>=pt)?pt:p;
 g.style.paddingBottom=np+"px";if(np<pt){np+=inc;
 setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);}
}

/* test */
function alertSize() {
  var myWidth = 0;//, myHeight = 0;
//  if( typeof( window.innerWidth ) == 'number' ) {
//    //Non-IE
//    myWidth = window.innerWidth;
//    myHeight = window.innerHeight;
//  } else 
if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    //myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    //myHeight = document.body.clientHeight;
  }
  
  return myWidth;
  //window.alert( 'Height = ' + myHeight );
}