﻿// Adjust footer according to the container height
function AdjustColumnsHeight()
{
var container = window.document.getElementById('main');
var hContainer = container.offsetHeight;
var maxHeight = hContainer;
var hContLeft = window.document.getElementById('contentLeft').offsetHeight;
var hContRight = window.document.getElementById('contentRight').offsetHeight;
var maxContentHeight = Math.max(hContLeft, hContRight);
window.document.getElementById('footer').style.marginTop = 0 + 'px';
window.document.getElementById('footer').style.top = maxHeight + 'px';
//window.document.getElementById('contentLeft').style.height = maxContentHeight + 'px';
//window.document.getElementById('contentRight').style.height = maxContentHeight + 'px';
window.document.getElementById('content').style.height = maxContentHeight + 'px';
if(window.document.getElementById('cCRt') != null)
{	
window.document.getElementById('container').style.background = 'url(App_themes/General/Layout/contentBg.png)';
}
if(window.document.getElementById('ctl00_phHomeService_dvwArticle_dvwR') == null)
{
window.document.getElementById('container').style.background = 'url(App_themes/General/Layout/contentBg.png)';
} else {
window.document.getElementById('container').style.background = 'url(App_themes/General/Layout/contentBg_w.png)';
}
}
// if this is the only one script file, uncomment the following line!
//window.onload = function(){ AdjustColumnsHeight();}
/*function HideShowShoppingCart()
{
if(window.document.getElementById('ctl00_btnShoppingCart') != null)
{window.document.getElementById('ctl00_pnlEShop').style.display = 'block';}
else
{window.document.getElementById('ctl00_pnlEShop').style.display = 'none';}
}*/
// show/hide the share article div
function showTagger(obj)
{
var el = window.document.getElementById(obj);
if(el != "")
{
if (el.style.display == "none")
{
el.style.display = "block";
} else {
el.style.display = "none";
}
} AdjustColumnsHeight();
}
// show/hide modal popus for logging
function ShowLoginPopup()
{
$find(
"openLogin").show();
HideRegisterPopup();
HidePasswordRecoveryPopup();
}
function HideLoginPopup()
{
$find(
"openLogin").hide();
}
function ShowRegisterPopup()
{
$find(
"openRegister").show();
HideLoginPopup();
HidePasswordRecoveryPopup();
}
function HideRegisterPopup()
{
$find(
"openRegister").hide();
}
function ShowPasswordRecoveryPopup()
{
$find(
"openPasswordRecovery").show();
HideLoginPopup();
HideRegisterPopup();
}
function HidePasswordRecoveryPopup()
{
$find(
"openPasswordRecovery").hide();
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 200,top = 200');");
}
function popUpMovie(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=780,height=580,left = 170,top = 72');");
}

function GetImage(ImageUrl, ret){

var currentImgId = ImageUrl;
$get('popImage').innerHTML = ImageUrl;  
var setimg = new Array();

function preloading(){
for (x=0; x<preloading.arguments.length; x++){
setimg[x] = new Image();
setimg[x].src = preloading.arguments[x];
setimg[x].alt = preloading.arguments[x];
//window.document.getElementById('ctl00_pnlImageUrlPopup').style.top = 0;
//window.document.getElementById('ctl00_upImagePopup').style.top = 0;
}
}
preloading(ImageUrl);

if (ret == false)
{
window.document.getElementById('popImage').innerHTML = "<img src=\"Images/"+ setimg[0].alt +"\" alt=\""+ setimg[0].alt + "\" />";
} else {
window.document.getElementById('popImage').innerHTML = "<img src=\"Images/"+ setimg[0].alt +"\" alt=\""+ setimg[0].alt + "\" />";
}
ShowImageUrlPopup();
}

function ShowImageUrlPopup()
{
$find(
"openImageUrl").show();
}
function HideImageUrlPopup()
{
$find(
"openImageUrl").hide();
}
var state = 'hidden';
function showhide(layer_ref) {
if (state == 'visible') {
state = 'hidden';
}
else {
state = 'visible';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
}