﻿// JScript File
//alert('thuty');
function initMasterPage() {
            if (window.screen.availWidth > 1023) {
                document.getElementById("div_wholepage").className="div_wholepage1";
            } else {
                document.getElementById("div_wholepage").className="div_wholepage2";
    }
}
function ForHelpPage(e) {
		if (document.getElementById("1").style.display == "none") {
			document.getElementById("1").style.display="block";
			document.getElementById("2").style.display="none";
			e.innerHTML="Hide TOC";
		} else {
			document.getElementById("1").style.display="none";
			document.getElementById("2").style.display="block";
			e.innerHTML="Show TOC";
		}
		return false;
	}
function showHideDiv(img, divName){
	d = document.getElementById(divName);
	if(d){
		if(d.style.display == "none"){
			d.style.display = "block";
			img.src = "images/nav_tabs/arrow_up.gif";
		}
		else{
			d.style.display = "none";
			img.src = "images/nav_tabs/arrow_down.gif";
		}
	}
}
function OpenWindowWithArgument(_urlLocation,_ctr){   
    var Valid=CheckUrlValid(_ctr);
    if(Valid==true){
         var _arg;
        _arg=document.getElementById(_ctr).value;
        window.open(_urlLocation+_arg,'_blank','height=100,width=200,location=no,resizable=no');            
    }    
    return false;
}
function OpenWindowDetail(_urlLocation,_width,_height){   
    window.open(_urlLocation,'_blank','height=' + _height+',width=' + _width +',location=no,resizable=no');            
    return false;
}
function CheckUrlValid(_ctr){
    var urlValue;
    urlValue=document.getElementById(_ctr).value;
    urlValue=urlValue.toLowerCase();    
    if(urlValue.indexOf(' ')>=0){
        alert('The url contains white space!');
        return false;
    }
    var filterShopName=new String('app_code,app_globalresources,app_themes,bin,forums,images,inc,library,personalinfo,shop,system,systemresource,thirdpartylibrary,usercontrols');
    if(filterShopName.indexOf(urlValue)>=0){
        alert('The url is special, so you can\'t choose it!');
        return false;
    }
    return true;
}

/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=30;
//var browserdetect;
function slowhigh(which2){
imgobj=which2;
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer();
instantset(baseopacity);
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100;
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree;
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99);
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10;
else if (window.highlighting)
clearInterval(highlighting);
}
 function ViewPicture(width, height, address){
    if (width>screen.availWidth || height>screen.availHeight){
        window.open(address);
    }
    else{
        window.open(address,"","width="+width+",height="+height+",resizable=no");
    }
}