﻿/////////////////////////////////////////////////////////////////////////////////////
//Check Agree
////////////////////////////////////////////////////////////////////////////////////
function check_agree(source, args)
{
    if (document.aspnetForm.ctl00$ContentPlaceHolder1$user_agree.checked==true)
    {
        args.IsValid = true;
    }                
    else
    {              
        args.IsValid = false;
    }
}
/////////////////////////////////////////////////////////////////////////////////////
//Paging
////////////////////////////////////////////////////////////////////////////////////
function ChangePage(id)
{
    // save the page clicked
    document.getElementById('ctl00_ContentPlaceHolder1_PageNumber').value = id;   
    // call the __doPostBack function to post back the form and execute the PageClick event
    __doPostBack('ctl00$ContentPlaceHolder1$PageCL','');		    
}
/////////////////////////////////////////////////////////////////////////////////////
//Image Slide Show
////////////////////////////////////////////////////////////////////////////////////
var currcur=0;
function intImg()
{	
	if(arImg.length < 2)
	{
		document.getElementById("previousholder").innerHTML = '';
		document.getElementById("nextholder").innerHTML = '';
	}
	if(arImg.length >0)
	{
		document.getElementById("imageholder").innerHTML = arImg[0];
	}
}
function prevRot()
{
	currcur= currcur -1 ;
	if(currcur <0)
	{
		currcur=arImg.length-1;
	}
	//alert(currcur);
	document.getElementById("imageholder").innerHTML = arImg[currcur];
}
function nextRot()
{
	currcur= currcur + 1 ;
	if(currcur > (arImg.length-1))
	{
		currcur=0;
	}
	//alert(currcur);
	document.getElementById("imageholder").innerHTML = arImg[currcur];
}
////////////////////////////////////////////////////////////////////////////////////
//correctly handle PNG transparency in Win IE 5.5 or higher.
////////////////////////////////////////////////////////////////////////////////////
//function correctPNG()
//   {
//   for(var i=0; i<document.images.length; i++)
//      {
//	  var img = document.images[i]
//	  var imgName = img.src.toUpperCase()
//	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
//	     {
//		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
//		 var imgClass = (imwg.className) ? "class='" + img.className + "' " : ""
//		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
//		 var imgStyle = "display:inline-block;" + img.style.cssText 
//		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
//		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
//		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
//		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
//		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
//	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
//		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
//		 img.outerHTML = strNewHTML
//		 i = i-1
//	     }
//      }
//   }



// External Links

//function externalLinks() {
// if (!document.getElementsByTagName) return;
// var anchors = document.getElementsByTagName("a");
// for (var i=0; i<anchors.length; i++) {
//   var anchor = anchors[i];
//   if (anchor.getAttribute("href") &&
//       anchor.getAttribute("rel") == "external")
//     anchor.target = "_blank";
// }
//}

//function initload() {
//	correctPNG();
//	externalLinks();
//}

//window.onload = initload;
////////////////////////////////////////////////////////////////////////////////////
//Hide and show script
////////////////////////////////////////////////////////////////////////////////////
function changediv(id)
{
	var viewp, conp
	viewp = "view"+id
	conp = "resp"+id
	if(document.getElementById(conp).style.display == '')
	{
		document.getElementById(conp).style.display = 'none';
		document.getElementById(viewp).innerHTML = "View";
	}
	else
	{
		document.getElementById(conp).style.display = '';
		document.getElementById(viewp).innerHTML = "Hide";
	}   
}