function doEnterKey() {
	if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) {
		document.form.submit();
	}

}

function GetHeightSize()
{
	var myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}

	return [ myHeight  ];
}

function getScrollY() 
{
	var scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop ;
	}
	
	scrOfY= scrOfY + ( GetHeightSize()/2 );

	return [ scrOfY  -300 + 'px' ];
}

function saveCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000))
		var expires = "; expires="+date.toGMTString()
	}
	else expires = ""
	document.cookie = name+"="+value+expires+"; path=/"
}
function readCookie(name) {
	var nameEQ = name + "="
	var ca = document.cookie.split(';')
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length)
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length)
	}
	return null
}
function deleteCookie(name) {
	saveCookie(name,"",-1)
}


function SetPopupDiv(id, url)
{

	document.getElementById('window' + id).style.top=getScrollY();
	
	var uplframe;
	if(document.getElementById("windowContentFrame"+ id))
	{
		//window.alert('Set Element');
		uplframe = document.getElementById("windowContentFrame"+ id);
	}
	else if(document.frames['windowContentFrame'+ id])
	{
		//window.alert('Set Frame');
		uplframe = document.frames['windowContentFrame'+ id];
	}

	uplframe.src = url;
}

function resetPopupDiv(id)
{
	var uplframe;
	if(document.getElementById("windowContentFrame"+ id))
	{
		//window.alert('Reset Element');
		uplframe = document.getElementById("windowContentFrame"+ id);
	}
	else if(document.frames['windowContentFrame'+ id])
	{
		//window.alert('Reset Frame');
		uplframe = document.frames['windowContentFrame'+ id];
	}
	
	uplframe.src = "";
}

function ShowHideDiv(id) {
    var div = document.getElementById(id);
    
    if (div) {
        
        if (div.style.display == 'none' || !div.style.display) {
            div.style.display = 'block';
            div.style.visibility = 'visible';
        }
        else {
            div.style.display = 'none';
            div.style.visibility = 'hidden';
        }
    }
}

function ShowHidePreview(idArrowToShow, idArrowToHide, idPrevToShow, idPrevToHide) {
    var arrowToShow = document.getElementById(idArrowToShow);
    var arrowToHide = document.getElementById(idArrowToHide);
    var prevToShow = document.getElementById(idPrevToShow);
    var prevToHide = document.getElementById(idPrevToHide);

    if (arrowToShow && arrowToHide && prevToShow && prevToHide) {

        arrowToShow.style.display = 'block';
        arrowToShow.style.visibility = 'visible';
        prevToShow.style.display = 'block';
        prevToShow.style.visibility = 'visible';
        
        arrowToHide.style.display = 'none';
        arrowToHide.style.visibility = 'hidden';
        prevToHide.style.display = 'none';
        prevToHide.style.visibility = 'hidden';
    }
}





