﻿function $get(strObj)
{
   return document.getElementById(strObj);
}
function ResizeIFrameHome(Page,iFrameName) {
 /*document.getElementById(frameName).style.width = getDocWidth(Page) + 'px';*/
 var m_height = (_getDocHeight(Page) + 20);
 $get(iFrameName).style.height = m_height + 'px';
 //if ($get("loadingDiv") != null)
     //$get("loadingDiv").innerHTML = ""; 
}

function WomenMenu(index)
{
    for(var i=1;i<=5;i++)
    {
        $get('Women_'+i).style.display = 'none';
    }
    $get('Women_'+index).style.display = 'block';
}    
function CloseItemsPopUp()
{
    $get('ItemsPopUpDiv').style.display = 'none';
}
var popUpTimer = null;
function StartPopUpTimer(index,type)
{
    popUpTimer=setTimeout("ShowItemPopUp('"+ index +"',"+type+")",500);
} 
function StopPopUpTimer()
{
    clearTimeout(popUpTimer);
}   
function ShowItemPopUp(index,type)
{
    clearTimeout(popUpTimer);
    for(var i=1;i<=17;i++)
    {
        $get('CT_'+i).className = 'SA1';
    }
    $get('CT_'+index).className = 'SA1Select';
    jQuery.facebox({ ajax: 'iframe/'+ index +'.html' });
    //jQuery.facebox('iframe/'+ index +'.html');
}        



/*Position */
function _getDocHeight(doc) {
 var docHt = 0, sh, oh;
 if (doc.height) docHt = doc.height;
 else if (doc.body) {
 if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
 if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
 if (sh && oh) docHt = Math.max(sh, oh);
 }
 return docHt;
}
function _getDocWidth(doc) {
 var docWt = 0, sw, ow;
 if (doc.width) docWt = doc.width;
 else if (doc.body) {
 if (doc.body.scrollWidth) docWt = sw = doc.body.scrollWidth;
 if (doc.body.offsetWidth) docWt = ow = doc.body.offsetWidth;
 if (sw && ow) docWt = Math.max(sw, ow);
 }
 return docWt;
}
function _getScrollPositionY()
{
 var y = 0;
 if( typeof( window.pageYOffset ) == 'number' ) {
 y = window.pageYOffset;
 } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
 y = document.documentElement.scrollTop;
 } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
 y = document.body.scrollTop;
 }
 return y + 50;
}
function _getCenterX()
{
 var x = 0;
 x = (_getDocWidth(document)/2);
 return x;
}
function _getWindowHeight() {
  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 myHeight;
}

function getElementLeft(Elem) {
		var elem;
		if(document.getElementById) {
			var elem = document.getElementById(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
		xPos = elem.offsetLeft;
		tempEl = elem.offsetParent;
  		while (tempEl != null) {
  			xPos += tempEl.offsetLeft;
	  		tempEl = tempEl.offsetParent;
  		}
		return xPos;
}
function getElementTop(Elem) {
		if(document.getElementById) {	
			var elem = document.getElementById(Elem);
		} else if (document.all) {
			var elem = document.all[Elem];
		}
		yPos = elem.offsetTop;
		tempEl = elem.offsetParent;
		while (tempEl != null) {
  			yPos += tempEl.offsetTop;
	  		tempEl = tempEl.offsetParent;
  		}
		return yPos;
}
/*Position */



