// FUNCTION TO GO ADMIN HOME
function cancelFunction(form,page_name)
{
	form.target = "_self";
	form.method="get";
	form.action=page_name;
	form.submit();
}
function cancelPostFunction(form,page_name)
{
	form.target = "_self";
	form.method="post";
	form.action=page_name;
	form.submit();
}
//FUNCTION TO CHECK EMPTY FIELD
function isEmpty(form,field_name,alertValue)
{
	if(form.elements[field_name].type=="select")
	{
		if(form.elements[field_name].selectedIndex==0)
		{
			alert(alertValue);
			form.elements[field_name].focus();
			return true;
		}
	}else
	{
		if(form.elements[field_name].value=="")
		{
			alert(alertValue);
			form.elements[field_name].focus();
			return true;
		}
	}
	return false;
}
//FUNCTION FOR PAGING
function pagingFunction(start,form,page_name)
{
	form.elements['start'].value=start;
	form.target="_self";
	form.method="get";
	form.action=page_name;
	form.submit();
}
//FUNCTION FOR PAGING 
function pageWiseFunction(form,offSet,page_name,pageWise)
{
	var pageWise = (pageWise)?parseInt(pageWise):0;
	var val = (pageWise<=1)?0:(pageWise-1)*parseInt(offSet);
	form.start.value = val;
	form.target="_self";
	form.method="get";
	form.action=page_name;
	form.submit();
}
//FUNCTION FOR PAGING 
function pageWiseChangeFunction(form,offSet,page_name,pageWise)
{
	var pageWise = (pageWise)?parseInt(pageWise):0;
	var val = (pageWise<=1)?0:(pageWise-1)*parseInt(offSet);
	form.istart.value = val;
	form.target="_self";
	form.method="get";
	form.action=page_name;
	form.submit();
}
//FUNCTION FOR PAGING BY COMBO BOX
function pageWiseComboFunction(form,offSet,page_name,pagewise2)
{
	if(pagewise2!='')
		var pageWise = pagewise2;
	else
		var pageWise = (form.pageWise.value)?parseInt(form.pageWise.value):0;
	var val=(pageWise==1)?0:(pageWise-1)*parseInt(offSet);
	form.start.value=val;
	form.target="_self";
	form.method="get";
	form.action=page_name;
	form.submit();
}

//FUNCTION FOR PAGING BY COMBO BOX
function pageWiseComboChangeFunction(form,offSet,page_name)
{
	var pageWise = (form.pageWise.value)?parseInt(form.pageWise.value):0;
	var val=(pageWise==1)?0:(pageWise-1)*parseInt(offSet);
	form.istart.value=val;
	form.target="_self";
	form.method="get";
	form.action=page_name;
	form.submit();
}
//Function For Check Pincode
function checkPincode(obj,e)
{
	var charcode = (e.keyCode)?e.keyCode:event.keyCode;
	var length=obj.value.length;
	if((length>=8 && charcode!=13 && charcode!=8 && charcode!=9 && charcode!=35 && charcode!=36 && charcode!=46 && charcode!=16) && (navigator.appName == 'Netscape'))
	{
		e.preventDefault();
	}
	if((length>=8 && charcode!=13 && charcode!=8 && charcode!=9 && !(charcode>=35 && charcode<=40) && charcode!=46 && charcode!=16) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter upto 8 digits.");
		return event.returnValue=false;
	}
}

function fix(fixNumber, decimalPlaces)
{
var div = Math.pow(10,decimalPlaces);
fixNumber = Math.round(fixNumber * div) / div;
return fixNumber;
}

//Function For Check Pincode
function checkPostcode(obj,e)
{
	var charcode = (e.keyCode)?e.keyCode:event.keyCode;
	var length=obj.value.length;
	if((length>=3 && charcode!=8 && charcode!=9 && charcode!=35 && charcode!=36 && charcode!=46 && charcode!=16) && (navigator.appName == 'Netscape'))
	{
		e.preventDefault();
	}
	if((length>=3 && charcode!=8 && charcode!=9 && !(charcode>=35 && charcode<=40) && charcode!=46 && charcode!=16) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter only 3 digits");
		return event.returnValue=false;
	}
}
//check spacebar function
function checkSpace(obj,e)
{
	var charcode = (e.keyCode)?e.keyCode:event.keyCode;
		if((charcode==32)  && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if(((charcode==32) || (charcode==13)) && (navigator.appName != 'Netscape'))
	{
		alert("Don't use space or enter for postcode.");
		return event.returnValue=false;
	}
}
//FUNTION THAT MAKE USER TO TYPE ONLY NUMERIC VALUES
function checkPhoneNumber(event)
{

	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	if((charcode>=65 && charcode<=90 && charcode!=86 ) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if((charcode>=65 && charcode<=90 && charcode!=86 ) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter numbers only.");
		return event.returnValue=false;
	}
}
//FUNTION THAT MAKE USER TO TYPE ONLY NUMERIC VALUES
function checkMobileNumber(event)
{

	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	if(!((charcode>=48 && charcode<=57) || (charcode==46)  || (charcode==110) || (charcode>=96 && charcode<=105) || (charcode>=8 && charcode<=9) || (charcode>=37 && charcode<=40)) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter numbers only");
		return event.returnValue=false;
	}
	if(!((charcode>=48 && charcode<=57) || (charcode==46) || (charcode==110) || (charcode>=96 && charcode<=105)|| (charcode==8) || (charcode>=37 && charcode<=40)) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
}

function checkComma(event)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	
	if((charcode==188 ) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if((charcode==188 ) && (navigator.appName != 'Netscape'))
	{
		alert("Please type only one location.");
		return event.returnValue=false;
	}
}

function checkCommaCity(event)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	
	if((charcode==188 ) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if((charcode==188 ) && (navigator.appName != 'Netscape'))
	{
		alert("Please type only one city.");
		return event.returnValue=false;
	}
}

function checkCommaCounty(event)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	
	if((charcode==188 ) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if((charcode==188 ) && (navigator.appName != 'Netscape'))
	{
		alert("Please type only one county.");
		return event.returnValue=false;
	}
}

function checkCommaCountry(event)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	
	if((charcode==188 ) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if((charcode==188 ) && (navigator.appName != 'Netscape'))
	{
		alert("Please type only one country.");
		return event.returnValue=false;
	}
}


function PhoneNumberFn(stringValue)
{
	var i=0, flag1=0, flag2=0;
	var num=parseInt(stringValue.length);
	var stringValue = stringValue.toLowerCase();
	var str_arr = stringValue.split('');	
	for(var i=0; i<num;i++)
	{
			if(str_arr[i]=='a' || str_arr[i]=='b' || str_arr[i]=='c' || str_arr[i]=='d' || str_arr[i]=='e' || str_arr[i]=='f' || str_arr[i]=='g' || str_arr[i]=='h' || str_arr[i]=='i' || str_arr[i]=='j' || str_arr[i]=='k' || str_arr[i]=='l' || str_arr[i]=='m' || str_arr[i]=='n' || str_arr[i]=='o' || str_arr[i]=='p' || str_arr[i]=='q' || str_arr[i]=='r' || str_arr[i]=='s' || str_arr[i]=='t' || str_arr[i]=='u' || str_arr[i]=='v' || str_arr[i]=='w' || str_arr[i]=='x' || str_arr[i]=='y' || str_arr[i]=='z' || str_arr[i]=='!' || str_arr[i]=='`' || str_arr[i]=='~' || str_arr[i]=='@' || str_arr[i]=='#' || str_arr[i]=='$' || str_arr[i]=='%' || str_arr[i]=='^' || str_arr[i]=='&' || str_arr[i]=='*' || str_arr[i]=='_' || str_arr[i]=='|' || str_arr[i]=='\\' || str_arr[i]=='/' || str_arr[i]=='?' || str_arr[i]=='.' || str_arr[i]=='>' || str_arr[i]=='<' || str_arr[i]==':'  || str_arr[i]==';' || str_arr[i]=='\''  || str_arr[i]=='"' || str_arr[i]=='['  || str_arr[i]==']' || str_arr[i]=='{'  || str_arr[i]=='}' || str_arr[i]=='/' || str_arr[i]=='+' || str_arr[i]=='-')
			{
			flag1++;
			}
	}
	if(flag1>=1)
		return true;
	else return false;
}

function PhoneNumberFuction(stringValue)
{
	var i=0, flag1=0, flag2=0;
	var num=parseInt(stringValue.length);
	var stringValue = stringValue.toLowerCase();
	var str_arr = stringValue.split('');	
	for(var i=0; i<num;i++)
	{
			if(str_arr[i]=='a' || str_arr[i]=='b' || str_arr[i]=='c' || str_arr[i]=='d' || str_arr[i]=='e' || str_arr[i]=='f' || str_arr[i]=='g' || str_arr[i]=='h' || str_arr[i]=='i' || str_arr[i]=='j' || str_arr[i]=='k' || str_arr[i]=='l' || str_arr[i]=='m' || str_arr[i]=='n' || str_arr[i]=='o' || str_arr[i]=='p' || str_arr[i]=='q' || str_arr[i]=='r' || str_arr[i]=='s' || str_arr[i]=='t' || str_arr[i]=='u' || str_arr[i]=='v' || str_arr[i]=='w' || str_arr[i]=='x' || str_arr[i]=='y' || str_arr[i]=='z' || str_arr[i]=='!' || str_arr[i]=='`' || str_arr[i]=='~' || str_arr[i]=='@' || str_arr[i]=='#' || str_arr[i]=='$' || str_arr[i]=='%' || str_arr[i]=='^' || str_arr[i]=='&' || str_arr[i]=='*' || str_arr[i]=='_' || str_arr[i]=='|' || str_arr[i]=='\\' || str_arr[i]=='/' || str_arr[i]=='?' || str_arr[i]=='.' || str_arr[i]=='>' ||  str_arr[i]=='<' || str_arr[i]==':'  || str_arr[i]==';' || str_arr[i]=='\''  || str_arr[i]=='"' || str_arr[i]=='['  || str_arr[i]==']' || str_arr[i]=='{'  || str_arr[i]=='}' || str_arr[i]=='/' || str_arr[i]=='+' || str_arr[i]=='-')
			{
			flag1++;
			}
	}
	if(flag1>=1)
		return true;
	else return false;
}

//Function to validate the Email Input
function emailfn(stringValue)
{
	var i=0, flag1=0, flag2=0;
	var num=parseInt(stringValue.length);
	var ch=stringValue.charAt(0);
	if(ch=='@' || ch=='.')
	return true;
	for(var i=0; i<num;i++)
	{
		var ch=stringValue.charAt(i);
		if(ch=='@')flag1++;
		else if(ch=='.')
		{
			var afterdot=i+2;
			flag2++; 
		}
	}
	if(stringValue.charAt(afterdot)=="")
		flag1=3;
	if(flag1!=1 || flag2==0)
		return true;
	else return false;
}
function checkfloat(event,obj)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	if(!((charcode>=48 && charcode<=57) || (charcode==46) || (charcode==190) || (charcode==110) || (charcode>=96 && charcode<=105) || (charcode>=8 && charcode<=9) || (charcode>=37 && charcode<=40)) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter numbers only");
		return event.returnValue=false;
	}
	if(!((charcode>=48 && charcode<=57) || (charcode==46) || (charcode==190) || (charcode==110) || (charcode>=96 && charcode<=105)|| (charcode==8) || (charcode>=37 && charcode<=40)) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	var val=obj.value;
	var flag=0;
	for(i=0;i<val.length;i++)
	{
		if(val.charAt(i)=='.')
		flag++;
	}
	if((flag>0) && (charcode==190))
		return event.returnValue=false;
}
// function for setting focus
function selectedFunctions(frm,s_location)
{
alert("hi");
}

// function for setting focus
function setFocus(frm,field_name)
{
	eval("frm."+field_name+".focus()");
}
//FUNCTION TO VALIDATE STRING LENGTH
function validateFunction(stringValue,val)
{
	if(stringValue.length<val)
		return true;
	else
		return false;
}
function checkvalue(event)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	if((charcode>=65 && charcode<=90) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
	if((charcode>=65 && charcode<=90) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter numbers only.");
		return event.returnValue=false;
	}
}
//function to change class
function rowOverEffect(object,classN)
{
  object.className = classN;
}

function rowOutEffect(object,classN)
{
  object.className = classN;
}
// to validate Unique 
function checkDateFunction(date1, date2)
{
	dateFrom=date1.split("-");
	dateTo=date2.split("-");
	if(dateFrom[2]<dateTo[2])
		return true;
	else if(dateFrom[2]>dateTo[2])
		return false;
	else
	{
		if(dateFrom[1]<dateTo[1])
			return true;
		else if(dateFrom[1]>dateTo[1])
			return false;
		else
		{
			if(dateFrom[0]<dateTo[0])
				return true;
			if(dateFrom[0]>dateTo[0])
				return false;
			else
				return true;
		}			
	}			
}
// to validate Unique 
function checkDateFunction1(date1, date2)
{
	dateFrom=date1.split("-");
	dateTo=date2.split("-");
	if(dateFrom[2]<dateTo[2])
		return true;
	else if(dateFrom[2]>dateTo[2])
		return false;
	else
	{
		if(dateFrom[1]<dateTo[1])
			return true;
		else if(dateFrom[1]>dateTo[1])
			return false;
		else
		{
			if(dateFrom[0]<dateTo[0])
				return true;
			else if(dateFrom[0]>=dateTo[0])
				return false;
			else
				return true;
		}			
	}			
}
function fix(fixNumber, decimalPlaces)
{
var div = Math.pow(10,decimalPlaces);
fixNumber = Math.round(fixNumber * div) / div;
return fixNumber;
}
	
function validateUniquePosition(Id,k)
{
	//for checking duplication
	for(i=1;i<=k;i++)
	{
		var iproduct_movie = Id+i;
		var product_moviei =document.getElementById(iproduct_movie).value;
		for(j=1;j<=k;j++)
		{
			var jproduct_movie = Id+j;
			var product_moviej = document.getElementById(jproduct_movie).value;
			if(product_moviei && product_moviej)
			{
				if(i!=j)
				{
					if(product_moviei==product_moviej)
					{
						alert("Enter Unique position");
						document.getElementById(jproduct_movie).focus();
						return j;
					}
				}
			}
		}
	}
	return 0;
}
function checkLengthValidate(e,obj,val)
{
	var charcode = (e.keyCode)?e.keyCode:event.keyCode;
	var length = obj.value.length;
	if((length>=val && charcode!=13 && charcode!=8 && charcode!=9 && !(charcode>=35 && charcode<=40) && charcode!=46 && charcode!=16) && (navigator.appName == 'Netscape'))
	{
		e.preventDefault();
	}
	if((length>=val && charcode!=13 && charcode!=8 && charcode!=9 && !(charcode>=35 && charcode<=40) && charcode!=46 && charcode!=16) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter upto "+val+" digits");
		return event.returnValue=false;
	}
}
function disableFunction(Obj,disable_field_name)
{
	if(Obj.value!="")
	{	
		disable_field_name.disabled = true;		
		disable_field_name.value = '- Not Applicable -';
	}
	else 
	{
		disable_field_name.disabled = false;	
		disable_field_name.value = '';	
	}
}

function next_function(form,page_name,index)
{
	var property_index=parseInt(index)+1;
	form.property_index.value=property_index;
	form.method="post";
	form.target="_self";
	form.action=page_name;
	form.submit();
}
function previous_function(form,page_name,index)
{
	var property_index=parseInt(index)-1;
	form.property_index.value=property_index;
	form.method="post";
	form.target="_self";
	form.action=page_name;
	form.submit();
}
/**
 * checks for length of textarea
 */
function checkLengthInTextarea(obj,event)
{
	var length = obj.value.length;
	document.getElementById("status").innerHTML= ""+length+" Character";
}
/**
 * checks for length of textarea
 */
function checkTextareaLength(obj,event,count)
{

	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	
	var length = obj.value.length;
	var remain = count-length;
	document.getElementById("status").innerHTML= ""+remain+" Character Remaining";
	if((length>=count) && (charcode!=8) && (charcode!=46) && (navigator.appName != 'Netscape'))
	{
		//alert("Please enter upto  "+count+"  Characters");
		return event.returnValue = false;
	}
	if((length>=count) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
}

function checkTextareaDescriptionLength(obj,event,count)
{

	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	
	var length = obj.value.length;
	var remain = count-length;
	document.getElementById("desc_status").innerHTML= ""+remain+" Character Remaining";
	if((length>=count) && (charcode!=8) && (charcode!=46) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter upto  "+count+"  Characters");
		return event.returnValue = false;
	}
	if((length>=count) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
}

/**
 * enables check all and uncheck 
 */
function checkallFunction(form)
{
	if(form.checkAll.checked==true)
		if(markAllRows()) return false;
	if(form.checkAll.checked==false)
		if(unMarkAllRows()) return false;
}
function checkallSecondFunction(form)
{
	if(form.checkAllSec.checked==true)
		if(markAllRowsSec()) return false;
	if(form.checkAllSec.checked==false)
		if(unMarkAllRowsSec()) return false;
}
/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;

/**
 * enables highlight and marking of rows in data tables
 *
 */
function PMA_markRowsInit() {
    // for every table row ...
    var rows = document.getElementsByTagName('tr');
    for ( var i = 0; i < rows.length; i++ ) {
        // ... with the class 'odd' or 'even' ...
        if ( 'odd' != rows[i].className.substr(0,3) && 'even' != rows[i].className.substr(0,4) ) {
            continue;
        }
        // ... add event listeners ...
            rows[i].onmouseover = function() {
                this.className += ' hover';
            }
            rows[i].onmouseout = function() {
                this.className = this.className.replace( ' hover', '' );
            }
        // Do not set click events if not wanted
        if (rows[i].className.search(/noclick/) != -1) {
            continue;
        }
        // ... and to mark the row on click ...
        rows[i].onmousedown = function() {
            var unique_id;
            var checkbox;

            checkbox = this.getElementsByTagName( 'input' )[0];
            if ( checkbox && checkbox.type == 'checkbox' ) {
                unique_id = checkbox.name + checkbox.value;
            } else if ( this.id.length > 0 ) {
                unique_id = this.id;
            } else {
                return;
            }

            if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
                marked_row[unique_id] = true;
            } else {
                marked_row[unique_id] = false;
            }

            if ( marked_row[unique_id] ) {
                this.className += ' marked';
            } else {
                this.className = this.className.replace(' marked', '');
            }

            if ( checkbox && checkbox.disabled == false ) {
                checkbox.checked = marked_row[unique_id];
            }
        }

        // ... and disable label ...
        var labeltag = rows[i].getElementsByTagName('label')[0];
        if ( labeltag ) {
            labeltag.onclick = function() {
                return false;
            }
        }
        // .. and checkbox clicks
        var checkbox = rows[i].getElementsByTagName('input')[0];
        if ( checkbox ) {
            checkbox.onclick = function() {
                // opera does not recognize return false;
                this.checked = ! this.checked;
            }
        }
    }
}
window.onload = PMA_markRowsInit;
/**
 * marks all rows and selects its first checkbox inside the given element
 * the given element is usaly a table or a div containing the table or tables
 *
 * @param    container    DOM element
 */
function markAllRows() {
    var rows = document.getElementById("table_results").getElementsByTagName('tr');
    var unique_id;
    var checkbox;
    for ( var i = 0; i < rows.length; i++ ) {
        checkbox = rows[i].getElementsByTagName( 'input' )[0];
        if ( (checkbox && checkbox.type == 'checkbox') && checkbox.name!='checkAll') {
            unique_id = checkbox.name + checkbox.value;
            if ( checkbox.disabled == false ) {
                checkbox.checked = true;
                if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
                    rows[i].className += ' marked';
                    marked_row[unique_id] = true;
                }
            }
        }
    }

    return true;
}
function markAllRowsSec() {
    var rows = document.getElementById("table_results_sec").getElementsByTagName('tr');
    var unique_id;
    var checkbox;
    for ( var i = 0; i < rows.length; i++ ) {
        checkbox = rows[i].getElementsByTagName( 'input' )[0];
        if ( (checkbox && checkbox.type == 'checkbox') && checkbox.name!='checkAllSec') {
            unique_id = checkbox.name + checkbox.value;
            if ( checkbox.disabled == false ) {
                checkbox.checked = true;
                if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
                    rows[i].className += ' marked';
                    marked_row[unique_id] = true;
                }
            }
        }
    }

    return true;
}
/**
 * marks all rows and selects its first checkbox inside the given element
 * the given element is usaly a table or a div containing the table or tables
 *
 * @param    container    DOM element
 */
function unMarkAllRows( container_id ) {
    var rows = document.getElementById("table_results").getElementsByTagName('tr');
    var unique_id;
    var checkbox;

    for ( var i = 0; i < rows.length; i++ ) {

        checkbox = rows[i].getElementsByTagName( 'input' )[0];

        if ( checkbox && checkbox.type == 'checkbox' ) {
            unique_id = checkbox.name + checkbox.value;
            checkbox.checked = false;
            rows[i].className = rows[i].className.replace(' marked', '');
            marked_row[unique_id] = false;
        }
    }

    return true;
}

function unMarkAllRowsSec( container_id ) {
    var rows = document.getElementById("table_results_sec").getElementsByTagName('tr');
    var unique_id;
    var checkbox;

    for ( var i = 0; i < rows.length; i++ ) {

        checkbox = rows[i].getElementsByTagName( 'input' )[0];

        if ( checkbox && checkbox.type == 'checkbox' ) {
            unique_id = checkbox.name + checkbox.value;
            checkbox.checked = false;
            rows[i].className = rows[i].className.replace(' marked', '');
            marked_row[unique_id] = false;
        }
    }

    return true;
}

function rowOverEff(object){  if (object.className == 'DataFONT') object.className = 'textOver';}
function rowOutEff(object) {  if (object.className == 'textOver') object.className = 'DataFONT';}

function popupnr1(mylink,windowname,refocus,width,height)
{
	var mywin, href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	mywin = window.open('', windowname, 'width='+width+',height='+height+',menubar=0,toolbar=0,status=1,scrollbars=1,resizable=0,location=0,directories=0');
	
	// if we just opened the window
	if (
	   mywin.closed || 
	   (! mywin.document.URL) || 
	   (mywin.document.URL.indexOf("about") == 0)
	   )
	  {
	  // mywin.document.body.style.backgroundColor = 'yellow';
	   //mywin.show(100,100,100,200,document.body);
	   mywin.location=href;
	   }
	else if (refocus)
	   mywin.focus();
	return false;
}

function popupnr2(mylink,windowname,refocus,width,height)
{
	var mywin, href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	mywin = window.open('', windowname, 'width='+width+',height='+height+',menubar=0,toolbar=0,status=1,scrollbars=1,resizable=1,location=0,directories=0');
	// if we just opened the window
	if (
	   mywin.closed || 
	   (! mywin.document.URL) || 
	   (mywin.document.URL.indexOf("about") == 0)
	   )
	   mywin.location=href;
	else if (refocus)
	   mywin.focus();
	return false;
}

function validateUniqueFeature1(Id,EId,k,l)
{
	//for checking duplication
	for(i=0;i<=k;i++)
	{
		var iproduct_movie = Id+i;
		var product_moviei =document.getElementById(iproduct_movie).value;
		
		for(m=0;m<=k;m++)
		{
			var mproduct_movie = Id+m;
			var product_moviem = document.getElementById(mproduct_movie).value;
			for(j=10;j<=l;j++)
			{
				var jproduct_movie = EId+j;
				var product_moviej = document.getElementById(jproduct_movie).value;
				if((product_moviei && product_moviem) || (product_moviei && product_moviej))
				{
					if((i!=m) && (i!=j))
					{
						if((product_moviei==product_moviem) || (product_moviei==product_moviej))
						{
							alert("Property Features Duplicated.");
							//document.getElementById(jproduct_movie).focus();
							return true;
						}
					}
				}
			}
		}
	}
	return 0;
}
function validateUniqueFeature2(Id,EId,k,l)
{
	//for checking duplication
	for(i=0;i<=k;i++)
	{
		var iproduct_movie = Id+i;
		var product_moviei =document.getElementById(iproduct_movie).value;
		
		for(m=0;m<=k;m++)
		{
		
			var mproduct_movie = Id+m;
			var product_moviem = document.getElementById(mproduct_movie).value;
			for(j=0;j<=l;j++)
			{
			
				var jproduct_movie = EId+j;
				var product_moviej = document.getElementById(jproduct_movie).value;
				
				if((product_moviei && product_moviem) || (product_moviei && product_moviej))
				{
					if((i!=m) && (i!=j))
					{
						if((product_moviei==product_moviem) || (product_moviei==product_moviej))
						{
							//var d=document.getElementById(iproduct_movie).value;
							
							alert("Property Features Duplicated.");//Enter unique Feature					
							document.getElementById(iproduct_movie).focus();
							//onfocus(document.getElementById(iproduct_movie).value);	
														//document.getElementById(jproduct_movie).focus();
							return true;
						}
					}
				}
				
			}
		}
	}
	
	return 0;
}
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function closeWindow()
{
	if(confirm(" Do you want to close this window?"))
	{
		window.close();
	}
}
function slideDown()
{
      document.getElementById('ShowOptions').style.display='none'; 
	  document.getElementById('HideOptions').style.display='block';
      document.getElementById('SearchOptions').style.display='block';
	  return false;
}
function slideUp()
{
      document.getElementById('ShowOptions').style.display='block'; 
	  document.getElementById('HideOptions').style.display='none';
      document.getElementById('SearchOptions').style.display='none';
	  return false;
}
function slideStand()
{
	if(document.getElementById('SearchOptions').style.display=='none')
	{
		document.getElementById('HideOptions').style.display='none'; 
	}
	if(document.getElementById('SearchOptions').style.display=='block')
	{
		document.getElementById('ShowOptions').style.display='none'; 	
		document.getElementById('HideOptions').style.display='block'; 

	}
	
}

function checkAppTextareaLength(obj,event,count)
{
	var charcode = (event.keyCode)?event.keyCode:event.keyCode;
	var length = obj.value.length;
	var remain = count-length;
	//document.getElementById("status").innerHTML= "[ Maximum "+count+" characters "+remain+" remaining ]";
	if(((length>=count) && (charcode!=46) && (charcode!=8)) && (navigator.appName != 'Netscape'))
	{
		alert("Please enter upto  "+count+"  Characters");
		return event.returnValue = false;
	}
	if(((length>=count) && (charcode!=46) && (charcode!=8)) && (navigator.appName == 'Netscape'))
	{
		event.preventDefault();
	}
}

function pointFunction()
{
	window.location="#property";
}
