<!-- Hide from non-JavaScript browsers
var hscr1, hscr2, hscr3; var img; var imgProps; var imgLeft; 
var images=1; var image; var usrid; var imgid;
var COLLAPSABLE_PARENT_NAME = "collapsable"; 
var COLLAPSABLE_PARENT_TYPE = "div"; 
var COLLAPSABLE_CHILD_TYPE = "pnlPage"; 
var COLLAPSABLE_EXPAND = "[expand]"; 
var COLLAPSABLE_SHRINK = "[shrink]"; 
aryImgs = new Array(5);
aryImgs[1] = "Archecture.jpg,Architecture,250,350,0";
aryImgs[2] = "People.jpg,People,250,200,70";
aryImgs[3] = "MarineLife.jpg,Marine Life,250,350,0";
aryImgs[4] = "WildLife.jpg,Wildlife,250,200,70";
function Start() {
	SetbgColor();
	init();
	if (document.getElementById("hidscr").value > '') {
		F800_CheckScroll();
	}
}
function RtnMsg(Err) {
	switch (Err) {
		case 1:
			alert("Email Address is required");
			break;
	}
}
function KDCMusic(inpPanel, inpMusic) {
	var ctlP=document.getElementById(inpPanel); 
	var tblCtl;
	tblCtl = document.createElement("<EMBED TITLE='Sound' "+
	   "width=250 height=50 autostart=true type='audio/x-ms-wma' "+
	   "hidden=true src='"+inpMusic+"'></NOEMBED>");
	ctlP.appendChild(tblCtl); 
}
function KDCVideo(inpPanel, inpVideo) {
	var ctlPv=document.getElementById(inpPanel); 
	var tblCtlv;
	tblCtlv = document.createElement("<EMBED "+
	   "width=400 height=400 autoplay=true "+
	   "src='"+inpVideo+"'>");
	while (ctlPv.hasChildNodes())
	{
		ctlPv.removeChild(ctlPv.firstChild);							
	}
	ctlPv.appendChild(tblCtlv); 
//	window.status='aaaajjjjj '+inpVideo.length;
}
function KDCPreview() {
//	var fldPass=document.getElementById("txtPreview");
//	fldPass.value="0315"; 
//	window.status='jjjjj '+fldPass.value;
}
function KDCAction() {
	var e = window.event;
	var obj = e.target || e.srcElement;
	var fldAction=document.getElementById("hidAction");
	fldAction.value=obj.id; 
//	fldAction.value=obj.id.substring(3,obj.id.length); 
//	window.status='button clicked '+obj.id+'-'+fldAction.value+'-'+obj.id.length;
}
function SetHgtWdt() {
    document.getElementById("imgView").style.height=document.body.clientHeight-20;      
    document.getElementById("imgView").style.width=document.body.clientWidth-20;
}
function SetbgColor() {
	var pnlBody=document.getElementById("pnlPage");
	document.bgColor=pnlBody.style.backgroundColor;
	//
	var HeadID = document.getElementsByTagName("head")[0]; 
	var cssTag = document.createElement('link');
	cssTag.type = 'text/css';
	cssTag.rel = 'stylesheet';
	cssTag.href = 'test.css';
	cssTag.media = 'screen';
	HeadID.appendChild(cssTag); 
}	
function ImageDisplay() {
	var e = window.event;
	var obj = e.target || e.srcElement;
	var imgtitle="test this";
	var imgsrc=obj.src;
	if (obj.title.substring(0,5) == 'http:') {
		window.open(obj.title,"");
		return;
	}
	if (obj.vhgt != null && obj.vwdt != null) {
	    var xa=obj.vhgt;
	    if (obj.vhgt != " ") {
			var shgt=parseInt(obj.vhgt)*80;
			var swdt=parseInt(obj.vwdt)*80;
			if (shgt == '0') return;    
			var whgt=(document.body.clientHeight / 2) / 2;
			var wwdt=(document.body.clientWidth / 2) / 2;
			//document.body.style.cursor='wait';
            var imgdoc=document.getElementById('imghpreview');
            imgdoc.style.height=shgt+'px';  
            imgdoc.style.width=swdt+'px';
            imgdoc.src=imgsrc; 
            var ajaxmodal=$find('mpebpreview');
            ajaxmodal._layout(); 
            ajaxmodal.set_PopupControlID('pnlPreview'); 
            ajaxmodal.initialize();  
            ajaxmodal.show();
			//window.open("kdcimgview.aspx?img="+imgsrc+"&site="+document.title,"","height="+shgt+",width="+swdt+",left="+wwdt+"px"+",top="+whgt+"px");
			return;
		}
	}
	var fldAction=document.getElementById("hidAction");
	var btnimg=document.getElementById("btnAct");
	fldAction.value=obj.id; 
	if (obj.title.substring(0,4) == "http") {
		fldAction.value=obj.title;
	}
	//document.getElementById("hidhld").value="Y";
	btnimg.click();
	//var tblent=document.createElement("<input type='button' runat='server'>";
	//pnlBody.appendChild(tblent); 
	//tblent.Click	
}
function ImageClose() {
    var ajaxmodal=$find('mpebpreview');
    ajaxmodal.hide();
}
function ReturnBack() {
	//window.history.back();
}
function Imgprotect() {
	var e = window.event;
	var obj = e.target || e.srcElement;
	var nobj;
	var msg="Images are not available for download. "+
	        "If you would like an image copy please contact us by email or "+
	        "phone. Thank You."; 
	if (event.button == 2 || event.button == 3) {
		window.alert('Thank you for visiting our site!');
    }
}
function TestCss() {
	var newcss = document.createElement("Link");
	newcss.rel="stylesheet";
	newcss.href="kdcweb/test.css";
	document.getElementsByTagName("head")[0].appendChild(newcss);                     
}
function F800_CheckScroll() {
		var hData=document.getElementById("hidscr").value.split('^');
		for (r=0; r < hData.length - 1; r++) {
			switch (r) {
				case 0: 
					hscr1=hData[r];
					F801_Scroll();							
					break;
				case 1: 
					hscr2=hData[1];
					F802_Scroll();							
					break;
			}								
		}
}
function F801_Scroll() {
	var tMsg=document.getElementById(hscr1);
	tMsg.innerText = tMsg.innerText.substring(1) + tMsg.innerText.substring(0,1);
	setTimeout('F801_Scroll()',200);
}		
function F802_Scroll() {
	var tMsg=document.getElementById(hscr2);
	tMsg.innerText = tMsg.innerText.substring(1) + tMsg.innerText.substring(0,1);
	setTimeout('F802_Scroll()',200);
}
function PageSize() {
	var e = window.event;
	var obj = e.target || e.srcElement;
	//alert("hhhhh");
	//var intHgt=obj.style.height.substring(0,obj.style.height.indexOf('p'));
	//intHgt=Number(intHgt)+100;
	//obj.style.height=intHgt+'px';
	//obj.style.width=intHgt+'px';
}
function PrintObj(obj) {
	var prtContent=document.getElementById(obj);
	var WinPrint = window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
	WinPrint.document.write(prtContent.innerHTML);
	WinPrint.document.close();
	WinPrint.focus();
	WinPrint.print();
	WinPrint.close();
}
function PrtWarning() {
	alert("Before printing the calendar change the printer orientation to Landscape.\n\n" +
	      "Click FILE then click PAGE SETUP.\n" +
	      "Change the ORIENTATION from Portrait to Landscape, then click OK.\n" +
	      "Click FILE then click PRINT. " +
	      "Choose the printer you wish to print to.");
}
function DisplayFlash(UserID) {
    usrid = UserID;
    imgid = "C044";
    txtid = "C045";
    if (document.getElementById(imgid) == null) return false;
    images=0;
	imgLeft=parseInt(document.getElementById(imgid).style.left);
    if (isNaN(imgLeft)) return false;
    DisplayImages();
}
function DisplayImages() 
 {
    loadimages();
    img=document.getElementById(imgid);
    img.id = imgid;
	img.src='Images/' + usrid + '/' + image;
	img.opacity = 0;
	img.style.left=imgLeft+'px';
	img.style.height=imgProps[2];
	img.style.width=imgProps[3];
	img.style.left=(Number(imgLeft)+Number(imgProps[4]))+'px';
	document.getElementById(txtid).value=imgProps[1];
	document.getElementById(txtid).style.width=imgProps[3];
	document.getElementById(txtid).style.left=img.style.left;
    setOpacity(img.id, 10, 200);
    window.setTimeout('DisplayImages();',5000);
 }
function setOpacity (imgID, step, delay) 
{
  img.opacity += step;
  img.style.filter = 'alpha(opacity = ' + img.opacity + ')'; 
  //if (document.all) img.style.filter = 'alpha(opacity = ' + img.opacity + ')'; 
  if (step > 0 && img.opacity < 200 || step < 0 && img.opacity > 0)
    setTimeout('setOpacity("' + img.id + '",' + step + ', ' + delay + ')', delay);
} 
function loadimages() {
    if (++images > 4) 
        images=1;
    imgProps=aryImgs[images].split(',');    
	image=imgProps[0];
}
function init() { 
    if(document.getElementById && document.createTextNode) { 
        var entries = document.getElementsByTagName(COLLAPSABLE_PARENT_TYPE); 
        for(i=0;i<entries.length;i++) 
            if (entries[i].className==COLLAPSABLE_PARENT_NAME) 
                assignCollapse(entries[i]); 
    } 
} 
function assignCollapse(div) { 
return;
    var button = document.createElement('a'); 
    button.style.cursor='pointer'; 
    button.setAttribute('expand', COLLAPSABLE_EXPAND); 
    button.setAttribute('shrink', COLLAPSABLE_SHRINK); 
    button.setAttribute('state', -1); 
    button.innerHTML='dsds'; 
    if (div.getElementsByTagName(COLLAPSABLE_CHILD_TYPE)[0] == undefined) return 0;
    div.insertBefore(button, div.getElementsByTagName(COLLAPSABLE_CHILD_TYPE)[0]); 

    button.onclick=function(){ 
        var state = -(1*this.getAttribute('state')); 
        this.setAttribute('state', state); 
        this.parentNode.getElementsByTagName(COLLAPSABLE_CHILD_TYPE)[0].style.display=state==1?'none':'block'; 
        this.innerHTML = this.getAttribute(state==1?'expand':'shrink'); 
    };                    
    button.onclick(); 
} 