<!--
var BROWSER_IE4 = "IE4"
var BROWSER_NN4 = "NN4"
var BROWSER_IE = "IE"
var BROWSER_VER;
BROWSER_VER = checkBrowser()

//if (document.layers) { // Netscape
    //document.captureEvents(Event.MOUSEMOVE);
    //document.onmousemove = captureMousePosition;
//} else if (document.all) { // Internet Explorer
    //document.onmousemove = captureMousePosition;
//} else if (document.getElementById) { // Netcsape 6
    //document.onmousemove = captureMousePosition;
//}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function checkBrowser() {
var BROWSER_VER;
  if (document.all && !document.getElementById) 
	BROWSER_VER = BROWSER_IE4
  else if (document.layers) 
	BROWSER_VER = BROWSER_NN4
  else if (document.getElementById) 
	BROWSER_VER = BROWSER_IE
  else 
	BROWSER_VER = BROWSER_IE
   return(BROWSER_VER)
}

//showSingleLevelTable

function showSingleLevelTable(tableToShow,position,leftPos,topPos,leftAdj,topAdj){
//alert("|")
if (everythingLoaded == true){

	var lyr = getMyHTMLElement(tableToShow);
	lyr.style.left =(getLeft(position) + leftAdj )+ "px";
	lyr.style.top = (getTop(position) + topAdj) + "px";
	showDisplayTable(tableToShow)
	}
}
function thinkAboutHidingTable(tableToHide){thinkAboutTimeOut = setTimeout("hideDisplayTable('"+tableToHide+"')",1000);}
function forgetAboutHidingTable(tableToHide){if (typeof thinkAboutTimeOut != 'undefined') {clearTimeout(thinkAboutTimeOut)}}



function showBubbleTable(tableToShow,position){
	holder = eval("document.all")
	holder[tableToShow].style.top = getTop(position)+5;
	holder[tableToShow].style.left = getLeft(position);
	if (holder[tableToShow].style.visibility == 'visible') {
	holder[tableToShow].style.visibility = 'hidden';
	}
	else{
	holder[tableToShow].style.visibility = 'visible';
	}

}

function OpenWindow(PageName,PageFrame,PageProperties) { //v2.0
  PageProperties= PageProperties +',scrollbars=1,resizable=1'
  MyWindow = window.open (PageName,PageFrame,PageProperties)
}

function download_document(newwindow){
	oselect = getMyHTMLElement("download")
	if (oselect != null){
		if(oselect.selectedIndex>=0)
			sfilename = oselect.options[oselect.selectedIndex].value
		if (sfilename!=''){
			sfilename = m_sstore_url + 'downloads/' + sfilename
			if (newwindow==1)
				open_win(sfilename,'download','scrollbars=yes,width=700,height=500')	
			else
				window.location = sfilename
		}
	}
}

function hideTables(tableToHide,indexNo){
if (document.all){
prefix = "document.all";}
else if (document.layers){
prefix = "document.layers";}
holder = eval(prefix)

for(i=1;i<indexNo+1;i++){

	if (prefix == "document.all"){
		holder[tableToHide + i].style.visibility = 'hidden';}
	else if (prefix == "document.layers"){
		holder[tableToHide + i].visibility = 'hidden';}
}

}



function switchTable(tableToShow){
	if (document.all){
		prefix = "document.all";}
	else if (document.layers){
		prefix = "document.layers";}
	holder = eval(prefix)
	if (prefix == "document.all"){
		if (holder[tableToShow].style.visibility == 'visible'){
			hideTable(tableToShow)
		}
		else{
			showTable(tableToShow)
		}
	}
	else if (prefix == "document.layers"){
		if (holder[tableToShow].visibility == 'visible'){
			hideTable(tableToShow)
		}
		else{
			showTable(tableToShow)
		}
	}
}



function showTable(tableToShow){
	if (document.layers) { // Netscape
		document.layers[tableToShow].visibility = 'visible';
	} else if (document.all) { // Internet Explorer
		document.all[tableToShow].style.visibility = 'visible';
	} else if (document.getElementById) { // Netcsape 6
		var lyr = getElemRefs(tableToShow);
		if (lyr && lyr.css) lyr.css.visibility = "visible";
	}
}

function showDisplayTable(tableToShow){
	getMyHTMLElement(tableToShow).style.display=''
}

function hideDisplayTable(tableToHide){
	getMyHTMLElement(tableToHide).style.display='none'
}

function thinkAboutHidingTable(tableToHide){
	thinkAboutTimeOut = setTimeout("hideDisplayTable('"+tableToHide+"')",100);
}

function forgetAboutHidingTable(tableToHide){
	if (typeof thinkAboutTimeOut != 'undefined') {clearTimeout(thinkAboutTimeOut)}
}


function hideTable(tableToHide){
	if (document.layers) { // Netscape
		document.layers[tableToHide].visibility = 'hidden';
	} else if (document.all) { // Internet Explorer
		document.all[tableToHide].style.visibility = 'hidden';
	} else if (document.getElementById) { // Netcsape 6
		var lyr = getElemRefs(tableToHide);
		if (lyr && lyr.css) lyr.css.visibility = "hidden";
	}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function swapImage(imageName,imageFile)
{
	var swapImageName = eval('document.' + imageName);
	swapImageName.src = imageFile;
}


function getTop(item){
var top =0;
var mywhere;
mywhere = document.all[item];
	while (mywhere.tagName.toLowerCase() != 'body')
	{
	top += mywhere.offsetTop;
	mywhere = mywhere.offsetParent;
	}
return top;
}
function getLeft(item){
var left =0;
var mywhere;
mywhere = document.all[item];
	while (mywhere.tagName.toLowerCase() != 'body')
	{
	left += mywhere.offsetLeft;
	mywhere = mywhere.offsetParent;
	}
return left;
}


function showTableMousePosition(tableToShow,position){
	if (document.all){
		prefix = "document.all";}
	else if (document.layers){
		prefix = "document.layers";}
	holder = eval(prefix)

	if (prefix == "document.all"){
		holder[tableToShow].style.top = yMousePos;
		holder[tableToShow].style.left = xMousePos; 
	}
	else if (prefix == "document.layers"){
		holder[tableToShow].top = yMousePos;
		holder[tableToShow].left = xMousePos;
	}
	showTable(tableToShow)
}

function printPage(){
window.print()
}

function addToFavorite(urlToAdd,titleToAdd)
{
	//window.external.AddFavorite(urlToAdd,titleToAdd)
	
    if (window.sidebar) {
        window.sidebar.addPanel(titleToAdd, urlToAdd,"");
    } else if( document.all ) {
        window.external.AddFavorite( urlToAdd, titleToAdd);
    } else if( window.opera && window.print ) {
        return true;
    }	
}

var folderX = ''
			function expandit2(curobj,showReq,forceShow){
				folderX=document.all[curobj.sourceIndex+showReq].style
					if (folderX.display=="none")
						folderX.display=""
					else
						folderX.display="none"
				if (forceShow == 1){folderX.display=""}
			}

function swapPlusFlags2(curobj,path){
			//curobj=document.all[curobj.sourceIndex+1]
			alert('path')
			if (curobj.src == path + "images/plus.gif"){
			curobj.src = path + "images/minus.gif";
			}
			else{
			curobj.src = path +  "images/plus.gif";
			}
			}

function ShowMessages(visibility) {

if (visibility == 'show') {
window.document.all.messageEditText.style.visibility='visible'
}else
{
window.document.all.messageEditText.style.visibility='hidden'
}
}

function Showfav(visibility) {

if (visibility == 'show') {
window.document.all.fav_layer.style.visibility='visible'
}else
{
window.document.all.fav_layer.style.visibility='hidden'
}
}


function setMenuScroll(td,table,maxSize){
	if (document.all[table].style.visibility == 'hidden')
		{
		document.all[table].style.height=1
		openScrollBoxMenu(table)
		setMenu(td,table)
		}
	}

function hideMenuScroll(table){
	hideMenu()
}

function openScrollBoxMenu(currentOptionBox)
	{
	if (parseInt(document.all[currentOptionBox].style.height) < 201)
		{
		document.all[currentOptionBox].style.height = (parseInt(document.all[currentOptionBox].style.height)+ 2) + 'px'
		timeO = setTimeout("openScrollBoxMenu('"+currentOptionBox+"')",1)
		}
	else{
	clearTimeout(timeO)
	}
	}


function open_win(url,wname,attr)
{
	if (wname=='undefined') wname = "win"
	if (attr=='undefined') attr = "toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=0,resizable=0,width=645,height=540"
	var new_win = window.open(url, wname, attr);
	new_win.focus();
}  
function redirectToValue(curObj)
{
	pathRedir = curObj.options[curObj.selectedIndex].value;
	if (pathRedir != "") {document.location.href = pathRedir}
}


function addall_products()
{
	var oformall = document.forms['frmaddallprod']
	var sskulist = '';
	var i=0,j=0;
	var aforms = oformall.formscount.value.split(',')
	var oform;
	var lqty=1;
	var sqtyobj='';
	//format parentguid|sku|quantity|sku display Type|text message
	//sku display type is used only for text message type
	for(i=0;i<=aforms.length-1;i++)
	{
		if (aforms[i]=='') continue;
		oform = document.forms[aforms[i]]
		askus = oform.skudetail.value.split(',')
		for(j=0;j<=askus.length-1;j++)
		{
			skudet = askus[j].split('=')
			octl = eval(oform.name + '.' + skudet[0])
			if(skudet[1]=='text')
			{
				sskulist = sskulist + octl.value + '|' + lqty + '#'
			}
			else if(skudet[1]=='radio')
			{
				for(k=0;k<=octl.length-1;k++) 
				{
					if(octl[k].checked & octl[k].value!='' )  
						sskulist = sskulist + octl[k].value + '|' + lqty +  '#'
				}
			}
			else if(skudet[1]=='select')
			{
					if(octl.selectedIndex>=0 && octl.options[octl.selectedIndex].value!='') 
						sskulist = sskulist + octl.options[octl.selectedIndex].value + '|' + lqty +  '#'
			}
			else if(skudet[1]=='checkbox')
			{
				if (isNaN(octl.length))
				{
					if(octl.checked && octl.value!='') 
						{sskulist = sskulist + octl.value + '|' + lqty +  '#'}
				}
				else				
				{
					for(k=0;k<=octl.length-1;k++) 
					{
						if(octl[k].checked && octl[k].value!='') 
							{sskulist = sskulist + octl[k].value + '|' + lqty +  '#'}
					}				
						
				}
			}						
			else if(skudet[1]=='message')
			{
				octltxt = eval(oform.name + '.' + 'message' + skudet[0].substring(3,skudet[0].length))
				if (octltxt.value!='')
				{
					sskulist = sskulist + octl.value.replace('%QTY%',lqty) +  '|' + octltxt.value + '#'
				}
			}
			lqty = 1
		}
	}
	oformall.skulist.value = sskulist
	oformall.submit()
}

function addprod_to_basket(sformname)
{
	var oform = document.forms[sformname]
	oform.submit()
}


function addprod_to_wishlist(sformname,surl)
{
	var oform = document.forms[sformname]
	oform.action = surl;
	oform.submit()
}


function limittext(field, maxlimit) 
{
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);

}


function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
//window.status = "xMousePos=" + xMousePos + ", yMousePos=" + yMousePos + ", xMousePosMax=" + xMousePosMax + ", yMousePosMax=" + yMousePosMax;

}

function popUp(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin"; 
}
			
function popUp2(url,w,h) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+w+',height='+h);
	self.name = "mainWin"; 
}


function CurrencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}

function CommaFormatted(amount)
{
	var delimiter = ",";
	var a = amount.split('.',2)
	var d = a[1];
	var i = parseInt(a[0]);
	if(isNaN(i)) { return ''; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	var n = new String(i);
	var a = [];
	while(n.length > 3)
	{
		var nn = n.substr(n.length-3);
		a.unshift(nn);
		n = n.substr(0,n.length-3);
	}
	if(n.length > 0) { a.unshift(n); }
	n = a.join(delimiter);
	if(d.length < 1) { amount = n; }
	else { amount = n + '.' + d; }
	amount = minus + amount;
	return amount;
}

function LTrim(str)
{
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str)
{
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {

      var i = s.length - 1;       // Get length of string

      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;

      s = s.substring(0, i+1);
   }

   return s;
}

function Trim(str)
{
   return RTrim(LTrim(str));
}

function getMyHTMLElement(sid)
{
	var oelement;
	if(BROWSER_VER==BROWSER_IE4)
		oelement = document.all[sid]
	else if(BROWSER_VER==BROWSER_NN4)
		oelement = document.layers[sid]
	else if(BROWSER_VER==BROWSER_IE)
		oelement = document.getElementById(sid)
	else
		oelement = document.getElementById(sid)
	return(oelement)
}
		function docjslib_getImageXfromLeft(imgID) {
			if (!document.all) return eval(imgID).x
			else return docjslib_getRealLeft(imgID);
		}

		function docjslib_getImageYfromTop(imgID) {
		if (!document.all) return eval(imgID).y
		else return docjslib_getRealTop(imgID);
		}
		function docjslib_getRealLeft(imgElem) {
			xPos = eval(imgElem).offsetLeft;
			tempEl = eval(imgElem).offsetParent;
  			while (tempEl != null) {
  				xPos += tempEl.offsetLeft;
  				tempEl = tempEl.offsetParent;
  			}
			return xPos;
		}

		function docjslib_getRealTop(imgElem) {
			yPos = eval(imgElem).offsetTop;
			tempEl = eval(imgElem).offsetParent;
			while (tempEl != null) {
  				yPos += tempEl.offsetTop;
  				tempEl = tempEl.offsetParent;
  			}
			return yPos;
		}


		function replaceString(aSearch, aFind, aReplace)
    {
    result = aSearch;
    if (result != null && result.length > 0)
        {
        a = 0;
        b = 0;
        while (true)
            {
            a = result.indexOf(aFind, b);
            if (a != -1)
                {
                result = result.substring(0, a) + aReplace + result.substring(a + aFind.length);
                b = a + aReplace.length;
            }
            else
            break;
        }
    }
    return result;
}

//REM -- Consumer Survey (#123681) - Murali Kanduri - 12/06/2009 - START 

var value = 0;
var overrideWidth = 0;
var overrideHeight = 0;
var valueForOverlay = 0;
var linkBoxForOverlay = ""

function ajaxGET(pageName,divID){
    currentHeight = 0
    var xmlhttp=false;
    try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch (E) {xmlhttp = false;}  }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {try {xmlhttp = new XMLHttpRequest();} catch (e) {xmlhttp=false;}}
    if (!xmlhttp && window.createRequest) {try {xmlhttp = window.createRequest();} catch (e) {xmlhttp=false;}}
    xmlhttp.open("GET", pageName, true); xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2005 00:00:00 GMT");
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
                getMyHTMLElement(divID).innerHTML = xmlhttp.responseText;
            }
        }
    xmlhttp.send(null)
}



function showPopupA(editorial_content,editorial_width,editorial_height,editorial_timer){    
    getMyHTMLElement('ajaxEditorial').style.left = ((document.documentElement.clientWidth - 600) /2) + 'px';
    getMyHTMLElement('ajaxEditorial').style.top = ((document.documentElement.clientHeight - 400) /2) + document.documentElement.scrollTop + 'px';
    
    getMyHTMLElement('ajaxEditorial').style.width = editorial_width + 'px';
    getMyHTMLElement('ajaxEditorial').style.height = editorial_height + 'px';
    
    ajaxGET('ajx_viewindex.asp?article_id=' + editorial_content,'ajaxEditorial',false);
    showPopup('ajaxEditorial',editorial_width,editorial_height,editorial_timer)
}



function getContentHeight() {
	
	var allTags = new Array();
	var contentHeight = 0;
	var spacingHeight = 0;
	
	allTags = document.getElementsByTagName('table');
	
	for (i=0;i<allTags.length;i++){
		
		if (allTags[i].className ="main"){
			spacingHeight = allTags[i].offsetTop - contentHeight;
			
			contentHeight = contentHeight + allTags[i].offsetHeight + spacingHeight;
		}
	
	}
	
	
	return contentHeight;
	
}




function showPopup(link,editorial_width,editorial_height,editorial_timer){
	
    linkBoxForOverlay = link;
	//alert(linkBoxForOverlay);
	var contentHeight = getContentHeight();

	if (contentHeight < document.body.offsetHeight) {
		getMyHTMLElement('overlayBox').style.height = document.body.offsetHeight + 'px';
	}
	else {
		getMyHTMLElement('overlayBox').style.height = contentHeight + 'px';
	}
	
    if (window.sidebar){fadeTimer = setTimeout("MOZ(linkBoxForOverlay)",editorial_timer)}
    else{
        if (document.all){fadeTimer = setTimeout("IE(linkBoxForOverlay)",editorial_timer)}
        else{fadeTimer = setTimeout("MOZ(linkBoxForOverlay)",editorial_timer)}
    }
	getMyHTMLElement('overlayBox').style.display='block';
	
	
	//REM -- Consumer Survey (#123681) - Daeheon Kim - 15/06/2009 - OVERLAY BG HEIGHT 
	
	if (editorial_height > document.body.offsetHeight) {
	
   		 getMyHTMLElement('overlayBox').style.paddingBottom = ((editorial_height) /2) + 'px';
		}
	
	else {
		getMyHTMLElement('overlayBox').style.height = document.body.offsetHeight + 'px';
		}
	
	
}



function hidePopup(){
    //getMyHTMLElement('overlayContent').style.display='none';
    getMyHTMLElement('overlayBox').style.display='none';
    if (window.sidebar){document.getElementById("overlayBox").style.MozOpacity=0;}
    if (document.all){document.getElementById("overlayBox").filters[0].opacity=0;}
    valueForOverlay = 0;
    if (linkBoxForOverlay !='') {hideDisplayTable(linkBoxForOverlay)}
    //hideAllSelectTags(false)
	
    }
	
function MOZ(link){
    if (valueForOverlay < 70){
        valueForOverlay = valueForOverlay + 10
        getMyHTMLElement("overlayBox").style.MozOpacity= valueForOverlay/100           		   
		getMyHTMLElement("overlayBox").style.opacity  = valueForOverlay/100  ;
		getMyHTMLElement("overlayBox").style.KhtmlOpacity = valueForOverlay/100 ;
        fadeTimer = setTimeout("MOZ(linkBoxForOverlay)",1)
    }
    else{
        //hideAllSelectTags(true);
		//alert(linkBoxForOverlay);
        showDisplayTable(linkBoxForOverlay)

    }
}
function IE(link){
    if (valueForOverlay < 70){
        valueForOverlay = valueForOverlay + 10
        document.getElementById("overlayBox").filters[0].opacity=valueForOverlay 
        fadeTimer = setTimeout("IE(linkBoxForOverlay)",1)
    }
    else{
        //hideAllSelectTags(true)
	    showDisplayTable(linkBoxForOverlay)

    }
}


//REM -- Consumer Survey (#123681) - Murali Kanduri - 12/06/2009 - END

//-->
