<!--
RowBGColor="#d9f2ff"; //When we click on checkbox in any manager then this bgcolor will be replaced with current BG
TableBGColor="";// default bgColor of rows
var height=window.screen.height;
var width=window.screen.width;

function IsEmptyCombine(string,errcode,amount) 
{
	txt = string.split("/")
	errstr = "Please complete the following fields:          \n";
	n = 0; 
	for (var i = 0; i < amount; i++){
		texterr = txt[i].split("|")
		if (eval(texterr[0]).value == ""){
			errstr =  errstr + '\n' + texterr[1];
			n++;
			if (n == 1)
				if (eval(texterr[0]).type == "text") eval(texterr[0]).focus();
				
		}
	}
	if (n == 0) errstr = "Empty"
	else{	
	alert(errstr)
	return true;
	}
}

function IsNumeric(object,ErrMsg,floatingpoint)
{
	if (floatingpoint == null) floatingpoint = false;
	
	if (floatingpoint) var stringallowed = "1234567890.-";
	else  			   var stringallowed = "1234567890";
	
	var stringval = object.value;
	
	if (!CheckDot(object,ErrMsg))return false;
	else{
		for (var i = 0; i < stringval.length; i++){
			if (stringallowed.indexOf(stringval.charAt(i)) == -1){
				object.focus();
				alert(ErrMsg)
				return false;
			}
		}
		return true;
	}
}
	
function CombineCondition(object,amount)
{
	var text = object.split("/")
	var errstr = "Please complete the following fields:          "+'\n'
	var n = 0; 
	for (var i=0; i<amount; i++)
	{
		var texterr = text[i].split("|")
		if (eval(texterr[0]).value == ""){
			errstr =  errstr +'\n'+ texterr[1]
			n=n+1;
			if (n==1) eval(texterr[0]).focus();
		}
	}
	if (n == 0){ 
		errstr == "Empty";
		return true;
	}
	else{	
		return errstr;
	}
}
	
function CheckDot(object,ErrMsg)
{
	var stringval = object.value;
	var Dot = 0;
	var seek = "."
	
	for (var i = 0; i < stringval.length; i++)
		if (seek.indexOf(stringval.charAt(i)) != -1)Dot++;
		
	if (Dot > 1){
		object.focus();
		alert(ErrMsg)
		return false;
	}	
	return true;
}  

function CheckNumeric(object,floatingpoint)
{
	var	topleft = (height - 250) / 2;
	var	leftscr = (width - 310) / 2;
	if (floatingpoint) var stringallowed = "1234567890.";
	else  			   var stringallowed = "1234567890";
	var stringval = object.value;
	if (object.value){
		for (var i = 0; i < stringval.length; i++){
			if (stringallowed.indexOf(stringval.charAt(i)) == -1){
				object.focus();
				return false;
			}
		}
		return true;
	}else return false
}

function IsInRange(object,ErrMsg,lowerlimit,upperlimit)
{
	var stringval = object.value;
	if ((stringval.length < lowerlimit)||(stringval.length > upperlimit)){
		if (object.type == "text" || object.type == "password" || object.type == "textbox") object.focus();
		alert(ErrMsg);
		return false;
	}else return true;
}

function CheckCondition(object,condition,ErrMsg)
{
	if (eval(condition)){
		if (object.type == "text" || object.type == "password" || object.type == "textbox") object.focus();
		alert(ErrMsg);
		return true;
	}
	return false;
}

function IsEmpty(object,ErrMsg)
{
	if (object.value == "")
	{
		if (object.type == "text" || object.type == "password" || object.type == "textbox") object.focus();
		alert(ErrMsg);
		return true;
	}else 
		return false;

}

function Empty(object,ErrMsg)
{
	if (object.value == "")
	{	if (object.type == "text" || object.type == "password" || object.type == "textbox") 
		object.focus();
		return true;
	}else 
		return false;

}


function SetText(object,Value)
{
	if (Value == 0 || Value == "0" || Value == "")
		object.value = "";
	else
		object.value = Value;
}

function IsString(object,ErrMsg,stringallowed,standard)
{
	var txtvalue = object.value;
	var validstring;
	if (standard) validstring = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()-+[]\{}|:;,./?><=\ ";
	else		  validstring = stringallowed;
	for (var i=0; i<txtvalue.length; i++) 
	{
		if (validstring.indexOf(txtvalue.charAt(i)) == -1)
		{
			if (object.type == "text" || object.type == "password" || object.type == "textbox") object.focus();
			alert(ErrMsg);
			return false;
		}
	}
	return true;
}

function CheckValueOnCheck(chkobject,object,errcode)
{
	var URL = "/error.asp?code="+ errcode
	if (chkobject.checked && object.value == ""){
		if (object.type == "text" || object.type == "password" || object.type == "textbox") object.focus();
		openwindow(URL,"PromptWindow")
		return false;
	}
	else return true;
}
	
function CheckSelectOnCheck(chkobject,selobject,errcode,zeroindex)
{
	var URL = "/error.asp?code="+ errcode
	if (zeroindex){
		if (chkobject.checked && selobject.selectedIndex == 0){
			openwindow(URL,"PromptWindow")
			return false;
		}
	}
	else {
		if (chkobject.checked == false && selobject.selectedIndex != 0)	{
			openwindow(URL,"PromptWindow")
			return false;
		}
	}
	return true;
}

function SelectListItem(object,value)
{
	for (i = 0; i < object.options.length; i++){
		if(object.options[i].value == value){
			object.options[i].selected = true
			break;
		}
	}
}

function SelectCheck(object,value)
{
	if (value == "True") object.checked = true
}	

function SelectCheckBoxes(name,object)
{
	var count = 0;
	for (var i = 0; i < Me.elements.length; i++)
	{
		var e = Me.elements[i];
		if ((e.name == name) && (e.type=="checkbox"))
		{
			count++;
			if (object == null){
				if (Me.chkSel.checked) e.checked = true;
			}else{
				if (object.checked)	   e.checked = true;
			}
		}
	}
	if (object == null){
		if (!Me.chkSel.checked && count == GC(name)) UALL(name);
	}else{
		if (!object.checked && count == GC(name))    UALL(name);
	}
}

function UALL(name)
{
	for (var i = 0; i < Me.elements.length; i++){
		var e = Me.elements[i];
		if ((e.name == name) && (e.type=="checkbox")) e.checked = false;
	}
}

function GC(name)
{
	var count = 0,e;
	for (var i = 0; i < Me.elements.length; i++){
		e = Me.elements[i];
		if ((e.name == name) && (e.type=="checkbox"))
			if (e.checked) count++;
	}
	return count;
}

function DC(object,parent)
{
	if (object.checked == false)
		parent.checked = false;
}

function SelectOptions(name)
{
	for (var i = 0; i < Me.elements.length; i++){
		var e = Me.elements[i];
		if ((e.name == name) && (e.type=="radio"))
			if (!e.checked) e.checked = true;
			else e.checked = false;
			 
	}
}
function IsGreater(object1,object2,errcode)
{
	var URL = "/error.asp?code=" + errcode
	if (object1 > object2){
			object1.focus();
			openwindow(URL,"PromptWindow")
			return true;
	}
	return false
}

function OpenDialog(file,msgcode,parameters)
{
	var	topleft = (height - 250) / 2;
	var	leftscr = (width - 310) / 2;
	if (msgcode == "")
		URL = file + "?" + parameters
	else
		URL = file + "?code=" + msgcode + "&" + parameters

	openwindow(URL,"PromptWindow")		

}

function Check(object,value)
{
		if (value == "True" || value == "1")
			object.checked = true;
		else
			object.checked = false;
}


function EmailCheck(object,errcode1,errcode2,errcode3,errcode4,errcode5,errcode6)
{
	if (object.value){
		var emailStr
			emailStr=object.value;

		var emailPat=/^(.+)@(.+)$/
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		var validChars="\[^\\s" + specialChars + "\]"
		var quotedUser="(\"[^\"]*\")"
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) {
			object.focus();
			var URL ="/error.asp?code=" + errcode1 
			openwindow(URL,"PromptWindow")
			return false
		}
		var user=matchArray[1]
		var domain=matchArray[2]

		if (user.match(userPat)==null) 
		{
			var URL ="/error.asp?code=" + errcode2 
			openwindow(URL,"PromptWindow")
		    return false
		}
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) 
		{
			  for (var i=1;i<=4;i++) {
			    if (IPArray[i]>255) {
			    var URL ="/error.asp?code=" + errcode3 
				openwindow(URL,"PromptWindow")
				return false
					}
				}
	    return true
		}
		var domainArray=domain.match(domainPat)
		if (domainArray==null) {
			object.focus();
			var URL ="/error.asp?code=" + errcode4 
			openwindow(URL,"PromptWindow")
			return false
		}
		var atomPat=new RegExp(atom,"g")
		var domArr=domain.match(atomPat)
		var len=domArr.length
		if (domArr[domArr.length-1].length<2 || 
			domArr[domArr.length-1].length>3) {
			object.focus();
			var URL ="/error.asp?code=" + errcode5 
			openwindow(URL,"PromptWindow")
			return false
		}
		if (len<2) {
			
			object.focus();
			var URL ="/error.asp?code=" + errcode6 
			openwindow(URL,"PromptWindow")
			return false
		}
		return true;
	}
}

function AlertMsg(Title,Msg)
{
	var winheight = 250;
	var winwidth = 320;
	var	topleft = (height - 250) / 2;
	var	leftscr = (width - 320) / 2;
	var URL = "/error.asp?code=AEER01&title=" + Title + "&msg=" + Msg;
	Child = window.open(URL,"error","height= "+winheight+",width= "+winwidth+", toolbar=no, menubar=no,top="+topleft+",left="+leftscr+",copyhistory=no,scrollbars=no,resizable=no")
	Child.focus(); 
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) Child.opener = self.parent; 
}

function openwindow(URL,mode)
{
	if (mode == "GeneralWindow"){
		if (width < 1024){
			winheight = height-80
			winwidth = 770
			var topleft = 2;			
			var leftscr = 8;
		}else{
			winheight = height-80
			winwidth = 764
			var topleft = 2;			
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "CheckoutWindow"){
		if (width < 1024){
			winheight = height-80
			winwidth = 770
			var topleft = 2;			
			var leftscr = 8;
		}else{
			winheight = height-80
			winwidth = 783;
			var topleft = 2;			
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "LearnWindow"){
		if (width < 1024){
			winheight = height-80
			winwidth = 780
			var topleft = 2;			
			var leftscr = 4;
		}else{
			winheight = height-105
			winwidth = 779
			var topleft = 15;			
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "EmailWindow"){
		if (width < 1024){
			winheight = 540
			winwidth = 706
			var topleft = 2;			
			var leftscr =(width - winwidth) / 2;
		}else{
			winheight = 700
			winwidth = 706
			var topleft = 10//(height - winheight) / 2;			
			var leftscr = (width - winwidth) / 2;
		}		
	}else if (mode == "Customize"){
		if (width < 1024){
			winheight = 540
			winwidth = 785
			var topleft = 1;
			var leftscr = 2;
		}else{
			winheight = 562
			winwidth = 800
			var topleft = (height - winheight) / 2;		
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "PreviewWindow"){
		if (width < 1024){
			winheight = height-80
			winwidth = 780
			var topleft = 2;			
			var leftscr = 3;
		}else{
			winheight = height-80
			winwidth = 800
			var topleft = 2;			
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "UploadWindow"){
		if (width < 1024){
			winheight = height-80
			winwidth = 790
			var topleft = 2;			
			var leftscr = 2;
		}else{
			winheight = height-80
			winwidth = 800
			var topleft = 2;			
			var leftscr = (width - winwidth) / 2;
		}

	}else if (mode == "URLWindow"){
		if (width < 1024){
			winheight = height-80
			winwidth = 790
			var topleft = 2;			
			var leftscr = 4;
		}else{
			winheight = 612
			winwidth = 800
			var topleft = 50 //(height - winheight) / 2;
			var leftscr = (width - winwidth) / 2;
		}	
		
	}else if (mode == "CategoryWindow"){
		if (width < 1024){
			winheight = 538
			winwidth = 790
			var topleft = 2//(height - winheight) / 2;			
			var leftscr = 1//(width - winwidth) / 2;
		}else{
			winheight = 538
			winwidth = 800
			var topleft = (height - winheight) / 2;		
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "PromptWindow"){
		var winheight = 250
		var winwidth = 320
		var	topleft = (height - 250) / 2;
		var	leftscr = (width - 320) / 2;
	}else if (mode == "FolderWindow"){
		var winheight = 300
		var winwidth = 500
		var	topleft = (height - 300) / 2;
		var	leftscr = (width - 500) / 2;
	}else if (mode == "ReportaBug"){
		if (width < 1024){
			var winheight = height-80;
			var winwidth = 532;
			var topleft = 2//(height - winheight) / 2;
			var leftscr = (width - winwidth) / 2;
		}else{
			var winheight = 650
			var winwidth = 535
			var topleft = 20
			var leftscr = (width - winwidth) / 2;
		}
	}else if (mode == "SiteOptions"){
		if (width < 1024){
			var winheight = 510
			var winwidth = 750
			var topleft = 10;
			var leftscr = (width - winwidth) / 2;
		}else{
			var winheight = 700
			var winwidth = 900
			var topleft = 2;
			var leftscr = (width - winwidth) / 2;
		}
	}else if(mode == "OpenTour"){
		if (width < 1024){
			var winheight = 536;
			var winwidth = 779;
			topleft = 2;	
			leftscr = 4;
		}else{
			var winheight = 536;
			var winwidth = 779;
			var topleft = (height - winheight) / 2;
			var leftscr = (width - winwidth) / 2;
		}
	}else if(mode == "CustomerSupport"){
		if (width < 1024){
			var winheight = height-80;
			var winwidth = 625;
			topleft = 2	
			var leftscr = (width - winwidth) / 2;
		}else{
			winheight = height-80
			winwidth = 630
			var topleft = 2;
			var leftscr = (width - winwidth) / 2;
		}
	}else if(mode == "OpenHelp"){
		winheight = height-80
		winwidth = width - 80
		var topleft = 2;
		var leftscr = (width - winwidth) / 2;
	}else if(mode == "ContactUs"){
		if (width < 1024){
			var winheight = 475;
			var winwidth = 794;
			topleft = 40;
			leftscr = 0
		}else{
			var winheight = 475;
			var winwidth = 794;
			var topleft = (height - winheight) / 2;
			var leftscr = (width - winwidth) / 2;
		}
	}else if(mode == "CreateAdPhoto"){
		if (width < 1024){
			var winheight = height-80;
			var winwidth = 595;
			topleft = 2	
			var leftscr = (width - winwidth) / 2;
		}else{
			winheight = height-80
			winwidth = 595
			var topleft = 2;
			var leftscr = (width - winwidth) / 2;
		}
	}
	var Child = new Object();
	
	if (mode == "PromptWindow"){
			Child = window.open(URL,"error","height= "+winheight+",width= "+winwidth+", toolbar=no, menubar=no,top="+topleft+",left="+leftscr+",copyhistory=no,scrollbars=no,resizable=no")
			Child.focus(); 
			if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) Child.opener = self.parent; 
	}else{
			Child = window.open(URL,mode,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,height="+winheight+",width="+winwidth+",top="+topleft+",left="+leftscr)
			Child.focus(); 
			if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
				//Child.document.write("<title>New Window</title><img src="+URL+" border=0>")
				Child.opener = self.parent; 
				
			}
	}
	//[object] is written to parent window in IE5
	//removed at 17-02-2003
	//return Child;
}
//-->