function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//clearing input fields start
function ClearInput(value, id){
var input = document.getElementById(id);
	if(value == input.value){
		input.value = ''; 
	}
	else{
		input.value = input.value;
	}
}
//clearing input fields end

//popUp that div start
var amID = "blank";
function showMe(containerId){
	if(amID != "blank" ){
		hideMe(amID);
	}
	if(amID != containerId){
	    amID = containerId;
	    showContainer(containerId);
	}else{
        amID = "blank";
    }
}

//popUp that div start
var amID = "blank";
function showMe(containerId,containerId2){
	if(amID != "blank" ){
		hideMe(amID);
		changeBack(amClassId);
	}
	if(amID != containerId){
	    amID = containerId;
	    showContainer(containerId);
		amClassId = containerId2;
		setClass(containerId2);
	}else{
        amID = "blank";
		amClassId = "blank";
    }
}
function showContainer(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}
function hideMe(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
//popUp that div end
//change that class then back start
var amClassId = "blank";
function setClass(containerId2){
	obj = MM_findObj(containerId2);
	if (!obj) return;
	obj.className = 'active';
}
function changeBack(containerId2){
	obj2 = MM_findObj(containerId2)
	if (!obj2) return;
	obj2.className = 'question';
}
//change that class then back end

//showSubNav end
//resize_iframe start
function resize_iframe(){
    document.getElementById("sizeframe").height=80;
}
function resize_iframe2(){
    document.getElementById("sizeframe").height=180;
}
//resize_iframe end

//fake file picker start
function copyText(){
	copyText1('realFile1','fakeFile1');
}

function copyText1(orgin, destination){
	txt1 = MM_findObj(orgin);
	txt2 = MM_findObj(destination);
	
	txt2.value = txt1.value;
}
//fake file picker end


/* Light Box Z-Tuned */
function changeheight(){
	if (window.innerHeight && window.scrollMaxY) {
		var yWithScroll = window.innerHeight + window.scrollMaxY;
		var lightBoxOverlayHeight = yWithScroll;
	} else {
		var yWithScroll = document.body.scrollHeight;
		var yHeight = document.body.clientHeight;
		var lightBoxOverlayHeight = yWithScroll + yHeight;
	}

	e = MM_findObj("lightBoxOverlay");
	e.style.height = lightBoxOverlayHeight + 'px';
}

function showLB(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	changeheight();
}
function showLBContent(containerId){
	showLB('lightBoxOverlay');
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}

function hideGallery(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}

function showGallery(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}

function hideLB(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}


function thisMovie(movieName) {
    return document[movieName];
}
function stopAll() {
    thisMovie('popupFLV').stopReel();
}
function hideAll(){
    hideLB('lightFlash');
    hideLB('lightFLV');
	hideLB('lightBoxOverlay');
	showGallery('flashContent');
	try {
	    stopAll();
	}
	catch (e) {

	}
}
function PostBackOnReturn(event, postbackMethod) {
    if (event) {
        if (event.keyCode == 13) {
            __doPostBack(postbackMethod, '');
        }
    }
}