function mypopup(C,T,R,W,H) 
{
out = window.open(C,T,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable='+R+',width='+W+',height='+H);
}
/*************************************************/
function selectall(){ 
t=document.frm.length; 

for(i=0; i<t; i++)
 { 
	document.frm[i].checked=true; 
 } 
}
/****************************************************/
function deselectall(){ 
t=document.frm.length; 

for(i=0; i<t; i++)
 { 
	document.frm[i].checked=false; 
 } 
}
/*************************************************/
function chek(myaction) 
{
var str=0;
  t=document.frm.length; 

for(i=0; i<t; i++)
 { 
    if(document.frm[i].checked)
	   {
	     str++;
	   } 
 } 
  
   if(str == 0)
    {
	  alert("Select Atleast One Record to Proceed");
	  return false;
	}
 	   else
		{   document.frm.action = myaction;
			document.frm.submit();
		}
}
/****************TD REPORT***********************/
function tdchek(actval,myaction) 
{
var str=0;
  t=document.frm.length; 

for(i=0; i<t; i++)
 { 
    if(document.frm[i].checked)
	   {
	     str++;
	   } 
 } 
  
   if(str == 0)
    {
	  alert("Select Atleast One Record to Proceed");
	  return false;
	}
   else if(str >25)
    {
	  alert("Select No More Than 25 Records to Proceed");
	  return false;
	}	
 	else
	{   
		document.frm.act.value = actval;
		document.frm.action = myaction;
		document.frm.submit();
	}
}
/***********Forgot Password*************************************/
function myforgotpwd()
{
theForm = document.frm;

if (theForm.username.value == "")
{
    alert("You must Enter Username/LoginID");
	theForm.username.focus();
	theForm.username.select();
	return false;
}
return true;
}
/*********************************************/
function myfunc(frm,act)
{
  this.document.frm.action = act;
  this.document.frm.submit();
}
/*******************************************/
function mycheck(frm)
{
theForm = document.frm;
	
	if(theForm.mcat)
	{
		if (!theForm.mcat.options[theForm.mcat.selectedIndex].value)
		{
			alert("Kindly Select Main Category");
			theForm.mcat.focus();
			return false;
		}
	}
	
	
	if(theForm.scat)
	{
		if (!theForm.scat.options[theForm.scat.selectedIndex].value)
		{
			alert("Kindly Select Sub Category");
			theForm.scat.focus();
			return false;
		}
	}
	
	
	
	if(theForm.title)
	{
		if (!theForm.title.value)
		{
			alert("Kindly Select Title");
			theForm.title.focus();
			theForm.title.select();
			return false;
		}
	}
	

/*
	if(theForm.icon)
	{
		if (!theForm.icon.value)
		{
			alert("Kindly Select Icon File");
			theForm.icon.focus();
			theForm.icon.select();
			return false;
		}
	}
	
*/	
	if(theForm.price)
	{
		if (!theForm.price.value)
		{
			alert("Kindly Enter Price Value");
			theForm.price.focus();
			theForm.price.select();
			return false;
		}
	}
	
	if(theForm.discount)
	{
		if (!theForm.discount.value)
		{
			alert("Kindly Enter Discount Value");
			theForm.discount.focus();
			theForm.discount.select();
			return false;
		}
	}
	
	
	if(theForm.shipping)
	{
		if (!theForm.shipping.value)
		{
			alert("Kindly Enter Shipping Cost");
			theForm.shipping.focus();
			theForm.shipping.select();
			return false;
		}
	}
	
	
	
	
return true;
}
/****************************************/
function applyFilter(filter)
{
	if((navigator.appVersion.indexOf("MSIE 5.5")!=-1||navigator.appVersion.indexOf("MSIE 6")!=-1||navigator.appVersion.indexOf("MSIE 7")!=-1)&&navigator.userAgent.toLowerCase().indexOf("opera")==-1)
for(var i=1;i<=s_ct;i++)document.all["s_m"+i].style.filter=filter;
	else 
	alert("These filter effects are only available to IE5.5+ users on Windows!")
}
/***************************************/
function show(name,src) {
    if (document.images)
        document.images[name].src = src;
}

/***************************************/
function showflash(vars,movie,width,height,wmode)
{
	var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="'+width+'" height="'+height+'"'
    + 'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="'+movie+'.swf" /><param NAME="wmode" VALUE="'+wmode+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="FlashVars" value="'+vars+'">'
    + '<embed src="'+movie+'.swf" FlashVars="'+vars+'" quality="high" bgcolor="#ffffff" wmode="'+wmode+'"'
    + 'width="'+width+'" height="'+height+'" name="ringSlide29" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="https://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(oeTags);   // embed the flash movie
	
}

/***************************************/
function enterdisable(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;
     else
          key = e.which;

     if(key == 13)
          return false;
     else
          return true;
}
/******************************************/
function mysearchchk(frm,act)
{
	theForm = document.frm;
/*
if(theForm.search)
	{
		if (0)
		//if (!theForm.search.value)
		{
			alert("Please Enter Search Text");
			theForm.search.focus();
			theForm.search.select();
			return false;
		}
	   else
		{   theForm.action = act;
			theForm.submit();
		}	
	}
*/

theForm.action = act;
theForm.submit();

return true;
}
/*******************************************/
function switchpage(select) {
  var index;

  for(index=0; index<select.options.length; index++)
    if(select.options[index].selected)
      {
        if(select.options[index].value!="")
          window.location.href=select.options[index].value;
        break;
      }
}

/**********************************************/

var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	
	function highlightTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(this!=activeRow){
			this.setAttribute('origCl',this.className);
			this.origCl = this.className;
		}
		this.className = arrayOfRolloverClasses[tableObj.id];
		
		activeRow = this;
		
	}
	
	function clickOnTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
		if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
			activeRowClickArray[tableObj.id].className='';
		}
		this.className = arrayOfClickClasses[tableObj.id];
		
		activeRowClickArray[tableObj.id] = this;
				
	}
	
	function resetRowStyle()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
			this.className = arrayOfClickClasses[tableObj.id];
			return;	
		}
		
		var origCl = this.getAttribute('origCl');
		if(!origCl)origCl = this.origCl;
		this.className=origCl;
		
	}
		
	function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}
		for(var no=0;no<rows.length;no++){
			rows[no].onmouseover = highlightTableRow;
			rows[no].onmouseout = resetRowStyle;
			
			if(whichClassOnClick){
				rows[no].onclick = clickOnTableRow;	
			}
		}
		
	}
/***********************************************************************/

