


function isIE()
{
version=0;
	if (navigator.appVersion.indexOf("MSIE")!=-1)
	{
		temp=navigator.appVersion.split("MSIE")
		version=parseFloat(temp[1])
	}
	if (version != 0)
	return version;
	else
	return false;
	
}

function IFrame_Mask(divtomask)
{
	if (isIE() != false)
	{
	var subobj=document.getElementById(divtomask);
	if (!document.getElementById(divtomask+'_mask'))
	{
		var objBody = document.getElementsByTagName("body").item(0);
		var objOverlay = document.createElement("Iframe");
		objOverlay.setAttribute('id',divtomask+'_mask');
		objOverlay.setAttribute('frameborder','0');
		objOverlay.setAttribute('scrolling', 'no');
		objOverlay.setAttribute('marginwidth', '0');
		objOverlay.setAttribute('src', 'javascript: false;');
		objOverlay.setAttribute('marginheight', '0');
		objOverlay.style.display = 'none';
		objOverlay.style.position = 'absolute';
		objOverlay.style.zIndex = '1';
		objOverlay.style.border = '0';
		
		objOverlay.style.left =  findPosX(subobj) + 'px';
		objOverlay.style.top = findPosY(subobj) + 'px';
		objOverlay.style.height = subobj.offsetHeight;
		objOverlay.style.width = subobj.offsetWidth;
		objOverlay.style.display = "inline";	
		
		objBody.appendChild(objOverlay);	
	}
	else
	{
	
		document.getElementById(divtomask+'_mask').style.left = findPosX(subobj) + 'px';
		document.getElementById(divtomask+'_mask').style.top = findPosY(subobj) + 'px';
		document.getElementById(divtomask+'_mask').style.height = subobj.offsetHeight;
		document.getElementById(divtomask+'_mask').style.width = subobj.offsetWidth;
		document.getElementById(divtomask+'_mask').style.display = "inline";
		document.getElementById(divtomask+'_mask').zIndex = '1';
	
	}
	}
	
}

function IFrame_UnMask(divtomask)
{	
	//document.getElementById("FXframe").style.display = "none";
	
	if (document.getElementById(divtomask+'_mask'))
	{
		var objBody = document.getElementsByTagName("body").item(0);
		objBody.removeChild(document.getElementById(divtomask+'_mask'));	
	}
}



function refresh_iframe(container)
{
IFrame_Mask(container);

}




  


  
function getCheckedValue(radioGroupName)
{
	radioObj= document.getElementsByName(radioGroupName);
	if(!radioObj)
		return "";
	
	  if (radioObj[0] && radioObj[0].type == "select-one")
	  {
		return document.getElementById(radioGroupName).options[document.getElementById(radioGroupName).selectedIndex].value;
	  }
	  else
	  {
			var radioLength = radioObj.length;
			if(radioLength == undefined)
				if(radioObj.checked)
					return radioObj.value;
				else
					return "";
			for(var i = 0; i < radioLength; i++) {
				if(radioObj[i].checked) {
					return radioObj[i].value;
				}
			}
			return "";
		}
}
function callback(){
			setTimeout(function(){
				$("#effect:visible").removeAttr('style').hide().fadeOut();
			}, 1000);
		};
		


function show_masked_popup(tt)
{
	if(tt.id)
		tt=tt.id;
		
	var docbody = document.getElementsByTagName("body").item(0);
	var options = {};

	

document.getElementById(tt).style.display = "block";
	//jQuery("#".tt).hide('clip',options,500,callback);
	
	//alert((docbody.offsetWidth/2));
	//alert((document.getElementById(tt).offsetWidth/2));
	document.getElementById(tt).style.left = (docbody.offsetWidth/2)-(document.getElementById(tt).offsetWidth/2)+"px";
	
	scroll(0,0);
	smoke_screen(true);
	//IFrame_Mask(tt);IFrame_Mask(tt);
	smoke_screen_refresh();
}

function hidepopup(tt)
{
	document.getElementById(tt).style.display = "none";
	IFrame_UnMask(tt);
	smoke_screen(false);
}


 function GetBrowserSize() {
	        
	     var xDimension, yDimension;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xDimension = window.innerWidth + window.scrollMaxX;
			yDimension = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xDimension = document.body.scrollWidth;
			yDimension = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xDimension = document.body.offsetWidth;
			yDimension = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		if(yDimension < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yDimension;
		}
	
		if(xDimension < windowWidth){	
			pageWidth = xDimension;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
	}
	
function smoke_screen(display_toggle)
{
	//GRAB BROWSER VERSOPM
	var version = 0;
	if (navigator.appVersion.indexOf("MSIE")!=-1){temp=navigator.appVersion.split("MSIE");version=parseFloat(temp[1]);}
	//IF NEWER THAN IE 5.5 (most visitors should be)
	if (version>=5.5 || version == 0) //NON IE browser will return 0
	{
		if(display_toggle)
		{
			var arrayPageSize =  GetBrowserSize();
			if (!document.getElementById('SmokeScreen'))
			{
				var objBody = document.getElementsByTagName("body").item(0);
				var objOverlay = document.createElement("div");
				objOverlay.setAttribute('id','SmokeScreen');
				objOverlay.style.display = 'none';
				objOverlay.style.overflow='hidden'; 
				objOverlay.style.position='absolute';             
				objOverlay.style.top='0px';                         
				objOverlay.style.left='0px';      
				
				objBody.appendChild(objOverlay);	
			}
			
			var smokeScreenObj = document.getElementById('SmokeScreen');
			
	 if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
	
			smokeScreenObj.style.width =  pageWidth;
			smokeScreenObj.style.height =  pageHeight;
			smokeScreenObj.style.display = "block";
		}
		else if (document.getElementById('SmokeScreen'))
			document.getElementById('SmokeScreen').style.display = "none";
	}
	
}

function smoke_screen_refresh()
{

			var smokeScreenObj = document.getElementById('SmokeScreen');
			smokeScreenObj.style.width =  getDocWidth() + 'px';
			smokeScreenObj.style.height =  getDocHeight() + 'px';
}


function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}


function getDocWidth() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
        Math.max(D.body.offsetWidth, D.documentElement.offsetWidth),
        Math.max(D.body.clientWidth, D.documentElement.clientWidth)
    );
}