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 loadPage(page)
{
	location.href=page;
}
function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return false;
}
function hideLayer(layerId){ 
  if(document.getElementById(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.getElementById(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 delAlert(msg)
{
	return confirm("Are you sure, you want to delete this " + msg + "?");
}
function delAlert(msg)
{
	return confirm("Are you sure, you want to delete this " + msg + ".");
}
function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}
// 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]();
}
function openPopup(url,name,width,height,pscroll,resize)
{
   if(pscroll=="undefined")
   pscroll="yes";
   if(resize=="undefined")
   resize="no";
   leftPosition =20;
   topPosition =20;	
   window.open(url, name,'top='+topPosition+',left='+leftPosition+',width='+width+',height='+height+',menubar=no,location=no,resizable='+resize+',scrollbars='+pscroll+',status=no');
   return false;
}

function display_flash(filename, fHeight, fWidth) 
{
	
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"')
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+fWidth+'" height="'+fHeight+'">')
		document.write('<param name="movie" value="'+filename+'">')
        document.write('<param name="quality" value="high">')
        document.write('<embed src="'+filename+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"')
		document.write('type="application/x-shockwave-flash" width="'+fWidth+'" height="'+fHeight+'"></embed></object>')
		
}
	
function display_flash_transparent(filename, fHeight, fWidth) 
{
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"')
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+fWidth+'" height="'+fHeight+'">')
		document.write('<param name="movie" value="'+filename+'">')
        document.write('<param name="quality" value="high">')
		document.write('<param name="wmode" value="transparent">')
        document.write('<embed src="'+filename+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"')
		document.write('type="application/x-shockwave-flash" width="'+fWidth+'" height="'+fHeight+'" wmode="transparent"></embed></object>')
		
}
function loadPngBackground(id,image)
{
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])
  if ((version >= 5.5) && (document.body.filters)) 
  {
	 document.write('<style>#'+id+'{ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+image+'",sizingMethod="scale"); }</style>');
  }
  else
  {
	 document.write('<style>#'+id+'{background: url('+image+');}</style>');
  }

}
function loadBrandPage(page)
{
 if(page.indexOf("contents/our-brands")==-1)
 {
	  window.open(page,'');
 }
 else
 {
	  location.href=page;
 }

	 
}
function loadImages(images)
{
	var imagesList =images.split(",");
    var preImages = new Array()
    for (i = 0; i < imagesList.length; i++) { 
		preImages[i] = new Image()
		preImages[i].src = imagesList[i];
	}
}
function openPopup(id,width,height,scrollbars,resize)
{
  var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,width="+ width +",height="+ height+ ",left=50,top=50"
  if(scrollbars==1)
  features+=",scrollbars=yes"
  else
  features+=",scrollbars=no"
  if(resize==1)
  features+=",resizable=yes"
  else
  features+=",resizable=no"
   
  thewin = window.open("../popup/popup.asp?ID="+id,'popup'+id,features);
  thewin.focus();
}