// JavaScript Document

function Global_validate(obj)
  {
    var len=obj.length;
	for(i=0;i<len;i++)
	  {
	    if(obj.elements[i].title!='' && obj.elements[i].value=='' && obj.elements[i].disabled==false)
		  {
		    alert(obj.elements[i].title);
			obj.elements[i].focus();
			return false;
		  }
	  }
	return true;
  }
  
  
  function removeSpaces(string,obj) 
	{
		var tstring = "";
		string = '' + string;
		splitstring = string.split(" ");
		for(i = 0; i < splitstring.length; i++)
		{
			tstring += splitstring[i];
		}
		obj.value=tstring;
	}

  function trimspaces(str)
		{
			while((str.indexOf(' ',0) == 0) && (str.length > 1))
			{
				str = str.substring(1, str.length);
			}
			while((str.lastIndexOf(' ') == (str.length - 1) && (str.length > 1)))
			{
				str = str.substring(0,(str.length - 1));
			}
			if((str.indexOf(' ',0) == 0) && (str.length == 1)) str = '';
			return str;
		}
		  
	function validate_form(Obj)
		{

				var paid=md=0;
				for ( i = 0; i < Obj.elements.length; i++) 
				{
						formElem = Obj.elements[i];
						
						if(formElem.name=='subs' && formElem.value=='paid' && formElem.checked==true)
							paid=1;
						
						if(paid==1)
						{
							if(formElem.name=='fee' && (formElem.value=='' || formElem.value==0 ))	
							{
								alert("Please Enter Fee Amount");
								formElem.focus();
								return false;
							}							
						}
						
						if(formElem.name=='mand' && formElem.value==1 && formElem.checked==true)
							md=1;
						
						if(md==1)
						{
							if(formElem.name=='mand_title' && formElem.value=='')	
							{
								alert("Please enter mandatory title");
								formElem.focus();
								return false;
							}							
						}
						
						if(formElem.name=='item_content' && formElem.value!='')
						{
							if(formElem.value.length>250)
							{
								alert("The item content should not exceed 250 characters");
								formElem.focus();
								return false;
							}
						}
						
						if(formElem.name=='item_content_russian' && formElem.value!='')
						{
							if(formElem.value.length>250)
							{
								alert("The item content should not exceed 250 characters");
								formElem.focus();
								return false;
							}
						}
						
						//alert(formElem.type);
						//alert(formElem.value);
						switch (formElem.type) {
								case 'text':
								case 'password':
								case 'select-one':
								case 'textarea':
								case 'file':
								case 'select-multiple':
										split_title=formElem.title.split("::");
										//alert(split_title[0]+"="+formElem.value);
										if(split_title[0]=='mandatory' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory2' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory2'  && isNaN(formElem.value)){
										alert('Please enter numeric value only');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory2'  && parseInt(formElem.value)<=0){
										alert('Please enter positive value grater than zero');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory3' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory3'){
											if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formElem.value)){
												
												}else{
													alert('Invalid E-mail Address! Please re-enter.');
													formElem.focus();
													return false;
											}
										}
										if(split_title[0]=='mandatory33' ){
											if(formElem.value !='')
												{
													if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formElem.value)){
														}else{
															alert('Invalid E-mail Address! Please re-enter.');
															formElem.focus();
															return false;
													}
												}
										}
										if(split_title[0]=='mandatory4' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory4' ){
											if(formElem.value !='')
												{
													var strLength = formElem.value.length;
													var spaceindex = formElem.value.lastIndexOf(' ');
													if(strLength < 6)
													{
														alert("Please enter "+formElem.name+" atleast 6 characters.");
														formElem.focus();
														return false;
													}
													if(spaceindex!='-1')
													{
														alert("Please remove space from "+formElem.name+".");
														formElem.focus();
														return false;
													}
												}
										}
										if(split_title[0]=='mandatory5' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory5' && !isNaN(formElem.value)){
										alert("Please enter only letters");
										formElem.focus();
										return false;
										}
										
										/*if(split_title[0]=='mandatory5')
										{
										var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz .";
										var checkStr = formElem.value;
										var allValid = true;
										for (i = 0;  i < checkStr.length;  i++)
										{
										ch = checkStr.charAt(i);
										for (j = 0;  j < checkOK.length;  j++)
										if (ch == checkOK.charAt(j))
										break;
										if (j == checkOK.length)
										{
										allValid = false;
										break;
										}
										}
										if (!allValid)
										{
										alert("Please enter only letter");
										formElem.focus();
										return false;
										}
										}*/
										
										if(split_title[0]=='mandatory6' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory6'  && isNaN(formElem.value)){
										alert('Please enter numeric value');
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory6'  && parseInt(formElem.value)<0){
										alert('Please enter positive value');
										formElem.focus();
										return false;
										}
										
										if(split_title[0]=='mandatory7' && trimspaces(formElem.value)!=''){
											if(split_title[0]=='mandatory7'  && isNaN(formElem.value)){
											alert('Please enter numeric value');
											formElem.focus();
											return false;
											}
											if(split_title[0]=='mandatory7'  && parseInt(formElem.value)<=0){
											alert('Please enter positive value');
											formElem.focus();
											return false;
											}
										}
										
										if(split_title[0]=='mandatory8' && trimspaces(formElem.value)!=''){
											if(split_title[0]=='mandatory8'  && isNaN(formElem.value)){
											alert('Please enter benchmark zone value between 1 to 100');
											formElem.focus();
											return false;
											}
											if(split_title[0]=='mandatory8'  && parseInt(formElem.value)<=0){
											alert('Please enter benchmark zone value between 1 to 100');
											formElem.focus();
											return false;
											}
											if(split_title[0]=='mandatory8'  && parseInt(formElem.value)>100){
											alert('Please enter benchmark zone value between 1 to 100');
											formElem.focus();
											return false;
											}
										}
										if(split_title[0]=='mandatory9' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory9' && formElem.value.length!=3){
										alert("Please enter 3 characters");
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory10' && trimspaces(formElem.value)!=''){
											if(split_title[0]=='mandatory7'  && isNaN(formElem.value)){
											alert('Please enter numeric value');
											formElem.focus();
											return false;
											}
										}
										if(split_title[0]=='Fill11' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='Fill11' ){
											if(formElem.value !='')
												{
													var strLength = formElem.value.length;
													var spaceindex = formElem.value.lastIndexOf(' ');
													if(strLength < 6)
													{
														alert("Please enter "+formElem.name+" atleast 6 characters.");
														formElem.focus();
														return false;
													}
													if(spaceindex!='-1')
													{
														alert("Please remove space from "+formElem.name+".");
														formElem.focus();
														return false;
													}
												}
										}
										if(split_title[0]=='Fill12' ){
											if(Obj.elements[i].value!=Obj.elements[i-1].value)
												{
													alert("Password Mismatched");
													formElem.focus();
													return false;
												}
										}
										/*if(split_title[0]=='mandatory9' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory91'){
										if(formElem.value !='')
												{
													var myImage = new Image();
													myImage.src = formElem.value;
													if(formElem.value.lastIndexOf('.gif') > -1 || formElem.value.lastIndexOf('.png') > -1 || formElem.value.lastIndexOf('.jpg') > -1 || formElem.value.lastIndexOf('.GIF') > -1|| formElem.value.lastIndexOf('.PNG') > -1 || formElem.value.lastIndexOf('.JPG') > -1 || formElem.value.lastIndexOf('.JPEG') > -1 || formElem.value.lastIndexOf('.jpeg') > -1){
													}else{
													msg="jpg, png or gif file can be upload! \n";
													alert(msg);
													formElem.focus();
													return false;
													}

													if ((myImage.width==Obj.elements[i+1].value) && (myImage.height==Obj.elements[i+2].value))
													{
													}
													else
													{
														alert('Please upload image of mentioned size');
														formElem.focus();
														return false;
													}
												}
										}
										
										
										if(split_title[0]=='mandatory10' && trimspaces(formElem.value)==''){
										alert(split_title[1]);
										formElem.focus();
										return false;
										}
										if(split_title[0]=='mandatory101'){
										if(formElem.value !='')
												{
												var aRequest;
												// Mozilla/Safari
												if (window.XMLHttpRequest)	
												{
													aRequest= new XMLHttpRequest();
												}
												// IE
												else if (window.ActiveXObject)	
												{
													aRequest = new ActiveXObject("Microsoft.XMLHTTP");
												}
													//var oas = new ActiveXObject("Scripting.FileSystemObject");
													var d = formElem.value;
													var e = oas.getFile(d);
													var f = e.size;
													alert(f + " bytes");
												}
											
										}*/
										
										
										if(split_title[0]=='mandatorygroup'){
											if(document.getElementById('group_radio1').checked == true)
											{
													if(document.getElementById('group_name').value=='' )
													{
														alert('Please Enter Group Name.');
														document.getElementById('group_name').focus();
														return false;
													}
													if(document.getElementById('comparison_option').value=='' )
													{
														alert('Please Select One Option.');
														document.getElementById('comparison_option').focus();
														return false;
													}
											}
											
											
											else if(document.getElementById('group_radio2').checked == true)
											{
													if(document.getElementById('group_name2').value=='' )
													{
														alert('Please Select Group Name.');
														document.getElementById('group_name2').focus();
														return false;
													}	
											}
											
										}
								break;
								}
						}//end of for loop
						return true;
		}  

function CheckAll(obj)
{
	//alert(obj);
	var count = obj.elements.length;
	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox' && obj.elements[i].name=='chk[]')
			obj.elements[i].checked = obj.chkall.checked;
	}
}

function doAction(action,obj,msgtype)
{
	//alert(action+" =="+obj);
	var count = obj.elements.length;
	
	var flag=false;
	var msg = "";
	if(msgtype !='')
	{
		msg = msgtype;	
	}
	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox')
		{
			if(obj.elements[i].checked == 1)
				flag=true;
		}
	}
	if(flag==true)
	{
		if(window.confirm("Are you sure want to delete "+msg))
		{
			obj.action.value=action;
			obj.submit();
		}
		else
		{
			var count = obj.elements.length;
			for (i=0; i < count; i++) 
			{
				obj.elements[i].checked =0;
				flag=false;
			}
		}
	}
	else
		alert("Please select at least one record to perform the action.");
}


function doShow(action,obj,mid)
{
	//alert(action+" =="+obj);
	
	var count = obj.elements.length;
	var count1=0;
	var flag=false;

	for (i=0; i < count; i++) 
	{
		if(obj.elements[i].type == 'checkbox' && obj.elements[i].name=='show[]')
		{

			if(obj.elements[i].checked==true)
				count1=count1+1;
				
			if(obj.elements[i].checked == true)
				flag=true;
		}
	}
	if(flag==true)
	{
		switch(mid)
		{
			case 2:
				if(count1>4)
				{
					alert("You can not select more than 4 fields to show");
					obj.unset.value=1;
				}
				else if(count1<4)
				{
					alert("You can not select less than 4 fields to show");
					obj.unset.value=1;
				}
			break;
			
			case 14:
			
				if(count1>3)
				{
					alert("You can not select more than 3 fields to show");
					obj.unset.value=1;
				}
				else if(count1<3)
				{
					alert("You can not select less than 3 fields to show");
					obj.unset.value=1;
				}
				break;
			
			case 5:
			case 17:
			case 6:
			
				if(count1>1)
				{
					alert("You can not select more than 1 fields to show");
					obj.unset.value=1;
				}
				break;
				
			default:
				break;
		}
		
		obj.action.value=action;
		obj.submit();
	}
	else
	{
		alert("Please select at least one Record to perform the action.");
		obj.unset.value=1;
		obj.submit();
	}
}

function delete_record(id,msgtype)
{
	var count = document.adminForm.elements.length;
	var flag=false;
	var msg = "";
	//alert(msgtype);
	if(msgtype !='')
	{
		msg = msgtype;
	}

	for (i=0; i < count; i++) 
	{
		if(document.adminForm.elements[i].type == 'checkbox')
		{
			if(document.adminForm.elements[i].value==id){
			document.adminForm.elements[i].checked =1;
			flag=true;
			}
		}
	}
	if(flag==true)
	{
		if(window.confirm("Are you sure want to delete "+msg))
		{
			document.adminForm.action.value='delete';
			document.adminForm.submit();
		}
	else
		{
			var count = document.adminForm.elements.length;
			for (i=0; i < count; i++) 
			{
				if(document.adminForm.elements[i].value==id)
				{
					document.adminForm.elements[i].checked =0;
					flag=false;
				}
			}
		}
	}
	
}


function delete_field(id,msgtype)
{
	var msg = "";
	if(msgtype !='')
	{
		msg = msgtype;
	}
	
	if(window.confirm("Are you sure want to delete "+msg))
	{
		document.adminForm.action.value='delete';
		document.adminForm.submit();
	}
}

//function delete_record(id)
//{
//	var count = document.adminForm.elements.length;
//	var flag=false;
//	var msg = "";
//	
//	for (i=0; i < count; i++) 
//	{
//		if(document.adminForm.elements[i].type == 'checkbox')
//		{
//			if(document.adminForm.elements[i].value==id){
//			document.adminForm.elements[i].checked =1;
//			flag=true;
//			}
//		}
//	}
//	if(flag==true)
//	{
//		if(window.confirm("Are you sure?\n"+msg))
//		{
//			document.adminForm.action.value='delete';
//			document.adminForm.submit();
//		}
//	else
//		{
//			var count = document.adminForm.elements.length;
//			for (i=0; i < count; i++) 
//			{
//					if(document.adminForm.elements[i].value==id)
//						{
//							document.adminForm.elements[i].checked =0;
//							flag=false;
//						}
//			}
//		}
//	}
//	
//}

function next_link(choice,lang_abbr)
{
	window.location.href='./?choice='+choice+'&lang_abbr='+lang_abbr;
}

function next_link1(choice,mod_id,usertype_id,lang_abbr)
{
	window.location.href='./?choice='+choice+'&mod_id='+mod_id+'&usertype_id='+usertype_id+'&lang_abbr='+lang_abbr;
}

function next_link2(choice,user_type,lang_abbr)
{
	var user_type=user_type;
	if(user_type=='')
		window.location.href='./?choice='+choice;
	else
		window.location.href='./?choice='+choice+'&usertype_id='+user_type+'&lang_abbr='+lang_abbr;	
}

function next_link3(choice,brand_id,lang_abbr)
{
	window.location.href='./?choice='+choice+'&brand_id='+brand_id+'&lang_abbr='+lang_abbr;
}

function next_link4(choice,brand_id,chapter_id,lang_abbr)
{
	window.location.href='./?choice='+choice+'&brand_id='+brand_id+'&chapter_id='+chapter_id+'&lang_abbr='+lang_abbr;
}
function next_link5(choice,mod_id,usertype_id,resource_category,lang_abbr)
{
	window.location.href='./?choice='+choice+'&mod_id='+mod_id+'&usertype_id='+usertype_id+'&resource_cat_id='+resource_category+'&lang_abbr='+lang_abbr;
}
function next_link6(choice,resource_cat,lang_abbr)
{
	var resource_cat=resource_cat;
	if(resource_cat=='')
		window.location.href='./?choice='+choice;
	else
		window.location.href='./?choice='+choice+'&resource_cat_id='+resource_cat+'&lang_abbr='+lang_abbr;	
}
function next_link7(choice,value,lang_abbr)
{
	window.location.href='./?choice='+choice+'&ns='+value+'&lang_abbr='+lang_abbr;
}
function add_content(choice,id,lang_abbr)
{
	window.location.href='./?choice='+choice+'&mod_id='+id+'&lang_abbr='+lang_abbr;
}

function delete_brand(obj,action,id)
{
	//alert(obj+"=="+action+",ooo=="+id);
	if(window.confirm("Are you sure want to delete the category.\n"))
		{
			//obj.action.value=action+":"+id;
			//obj.submit();
		}
		return false;
}
function submit_status(what,choice,super_id)
{
	location.href=("./?choice="+choice+"&status="+what.value+"&super="+super_id);
	//location.href=("index.php?cat=2&category_status="+what.value);
	
}
function submit_category(what)
{
	
	//var what = what.value;
	location.href=("./?choice=5&pi=1&status="+what.value);
	
}


function brand_status(action,what,lang_abbr)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?choice=6&ci="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}
	
function item_status(action,what,lang_abbr)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?choice=19&ci="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}	
	
function page_status(action,what,lang_abbr)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?choice=22&ci="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}		

function product_status(action,what,brand_id,chapter_id,lang_abbr,choice)
	{
		var lstart=document.adminForm.limitstart.value;
		if(brand_id!=0)
			location.href=("./?choice="+choice+"&ci="+what+"&brand_id="+brand_id+"&chapter_id="+chapter_id+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
		else
			location.href=("./?choice="+choice+"&ci="+what+"&chapter_id="+chapter_id+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}		
function language_status(action,what)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?choice=19&li="+what+"&status="+action+"&limitstart="+lstart);
	}
function category_status(action,what,lang_abbr)
	{
		var lstart=document.frm_category.limitstart.value;
		location.href=("./?choice=5&cati="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}
function user_status(action,what,usertype_id,lang_abbr)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?&usertype_id="+usertype_id+"&choice=7&user_id="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}
	function book_status(action,what,lang_abbr)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?&choice=11&book_id="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}
	
	
function usertype_status(action,what,lang_abbr)
	{
		var lstart=document.frm_user.limitstart.value;
		location.href=("./?choice=20&usertype_id="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}

function learner_status(action,what)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?choice=9&li="+what+"&status="+action+"&limitstart="+lstart);
	}
function instructor_status(action,what)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?choice=8&Ii="+what+"&status="+action+"&limitstart="+lstart);
	}


function showmand(chk)
{
	if(chk==0)
		document.getElementById('mand_title').disabled=true;
	
	if(chk==1)
	{
		document.getElementById('mand_title').disabled=false;
		document.getElementById('mand_title').focus();
	}
}

function language(what,choice,type)
{
	var language=what.value;
	var choice=choice;
	var type=type;
	location.href=("./?choice="+choice+"&lang_abbr="+language+"&usertype_id="+type);
}
function main_language(what,query_string)
{
	var language=what.value;
		
	var string=query_string;
	
	if(string.indexOf('?')>-1)
		location.href=("."+string+"&lang_abbr="+language);
	else	
		location.href=("./?"+string+"&lang_abbr="+language);
}

function main_language_front(what,pg,query_string)
{
	if(what.src)
	{
		if(what.id=='en')
			var language='en';
		else
			var language='ru';
	}
		
	var string=query_string;
	
	//alert("pg==>  "+pg);
	//alert("string==>  "+string);
	//return false;
	if(string.indexOf('?')>-1)
	{
		
		location.href=("./"+string+"&lang_abbr="+language);
	}
	else	
	{
		
		location.href=("./"+string+"?lang_abbr="+language);
	}
}

function main_language_front_new(what, query_string){
	if(what != 'en' && what != 'ru') return false;
	var string=query_string;
	
	if(string.indexOf('?')>-1){
		location.href=("./"+string+"&lang_abbr="+what);
	}
	else{
		location.href=("./"+string+"?lang_abbr="+what);
	}
}


function usertype(what,choice,id,lang)
{
	var usertype=what;
	var choice=choice;
	location.href=("./?choice="+choice+"&usertype_id="+usertype+"&mod_id="+id+"&lang_abbr="+lang);
}


function viewdetail(what,choice,pay_type,lang)
{
	var viewby=what.value;
	var choice=choice;
	location.href=("./?choice="+choice+"&view_by="+viewby+"&pay_type="+pay_type+"&lang_abbr="+lang);
}



function viewproductcat(what,choice,lang)
{
	var category_id=what.value;
	
	var choice=choice;
	location.href=("./?choice="+choice+"&category_id="+category_id+"&lang_abbr="+lang);
}


function viewproductbrand(what,choice,lang,brand)
{
	var brand_id=what.value;
	var category_id=brand;
	
	var choice=choice;
	location.href=("./?choice="+choice+"&brand_id="+brand_id+"&category_id="+category_id+"&lang_abbr="+lang);
}


function onKeyPressBlockNumbers(e)
{
	
 var key = window.event ? e.keyCode : e.which;
//alert(key)
 if(key==8 || key==45 || key==11 || e.keyCode==36 || e.keyCode==35 || e.keyCode==46 || e.keyCode==9 || e.keyCode==116 || e.keyCode==37 || e.keyCode==39) return true;


/* if(key==45) return true;
 if(key==11) return true;
 if(e.keyCode==9) return true;
 if(e.keyCode==116) return true;
 if(e.keyCode==37) return true;
 if(e.keyCode==39) return true;*/
 
var keychar = String.fromCharCode(key);
 reg = /\d/;
 return reg.test(keychar);
}



function disp_product(frm,id)
{
	if(id==0)
	{
		document.getElementById('add_product').style.display='none';	
		document.getElementById('txtproduct').style.display='none';	
		document.getElementById('linkproduct').style.display='';	
		frm.submit();
	}
	else
	{
		document.getElementById('add_product').style.display='';	
		document.getElementById('txtproduct').style.display='';
		document.getElementById('linkproduct').style.display='none';	
	}
}


function popUp1(URL) {
//eval("window.open(URL, '" + id + "');");
eval("window.open(URL, 'toolbar=0,scrollbars=1,location=0,fullscreen=1,statusbar=0,menubar=0,resizable=0,left = 150,top = 100, width=670,height=480');");
}


function data_status(action,what,lang_abbr,choice,table)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?&choice="+choice+"&"+table+"_id="+what+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}


function data_status1(action,what,lang_abbr,choice,table,cat,brand)
	{
		var lstart=document.adminForm.limitstart.value;
		location.href=("./?&choice="+choice+"&"+table+"_id="+what+"&category_id="+cat+"&brand_id="+brand+"&status="+action+"&limitstart="+lstart+"&lang_abbr="+lang_abbr);
	}
	

function set_combo_brand(obj,id,lang_abbr)
{
	location.href=("./?choice=1812&id="+id+"&brand="+obj+"&lang_abbr="+lang_abbr);
}

function popitup(url) 
{
	newwindow=window.open(url,'','toolbar=0,scrollbars=1,location=0,height=500,width=800,left=100,top=100');
	if (window.focus) {newwindow.focus()}
	return false;
}
function popittest(url) 
{
	newwindow=window.open(url,'','toolbar=0,scrollbars=1,location=0,height=550,width=600,left=200,top=100');
	if (window.focus) {newwindow.focus()}
	return false;
}

function show(id,tog)
{
	if(tog==1)
		document.getElementById(id).style.display="";
	else	
		document.getElementById(id).style.display="none";
}
function delete_prod(id)
{
	if(confirm("Do you want to delete the image?"))
	{
		document.getElementById('delid').value=id;
		document.adminForm.submit();
	}	
}

/*function showprev(img)
{
	document.getElementById('divshow').innerHTML="<img src=../content/"+img+">";	
}
*/

