<!--
//var HOST = '127.0.0.1:82/php4/DatingWeb/Zend_P/index.php';

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") + (path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 180 * 24 * 60 * 60 * 1000);
    if (f.f_usr_login != undefined)
       setCookie('cook_f_usr_login', f.f_usr_login.value, now, '/', '', '');
    if (f.f_usr_pass != undefined)
       setCookie('cook_f_usr_pass', f.f_usr_pass.value, now, '/', '', '');
    
}

function forgetMe (f) {
    deleteCookie('cook_f_usr_login', '/', '');
    deleteCookie('cook_f_usr_pass', '/', '');
    f.cook_f_usr_login.value = '';
    f.cook_f_usr_pass.value = '';
}


function openIMChat(id , name, windowname , from , status){
	
	var today  =  new  Date();
	window.open("?module=TChat&action=TChatHome&mebkey="+id+"&mebname="+name+"&from="+from+"&status="+status,windowname,"width=700,height=400,status=no");
}

function checkEffectiveChars(p){ 
	var l = p.length; 
	var count=0; 
	for(var i=0; i<l; i++){ 
		var digit = p.charAt(i); 
		if((digit >= "0" && digit <= "9") || (digit >= "a" && digit <= "z") || (digit >= "A" && digit <= "Z") ){
			
		} else {
			count ++;
		}
	} 
	
	if(count > 0){
		return false; 
	}else{
		return true; 
	}
	
} 

function displayClose(url){
	window.open(url,"","width=0,height=0,status=no");
}

function doZoom(size){
	//document.getElementById('zoom').style.fontSize=size+'px'
	var now = new Date();
	fixDate(now);
	now.setTime(now.getTime() + 180 * 24 * 60 * 60 * 1000);
	setCookie('fontsize', size, now, '/', '', '');

	var i =0;
	for(i = 1 ; i <= 50 ; i ++){
		var xx = "document.getElementById('zoom"+i+"')";
		var yy = eval(xx);
		if(yy != null){
			eval("document.getElementById('zoom"+i+"').style.fontSize='"+size+"px';");
		}
		
	}
}

function to(url){	
	
	var value = document.getElementById("alamo").value;
	if(value == null || value.length ==0 ){
		alert("please make sure you have selected one record!");
	}else{
		
		if(confirm('Are you sure to delete this record?')){
			window.location.href=url+"&alamo="+value;
		}
		
	}
	
}


function deleteIt(){	
	
	var value = document.getElementById("alamo").value;
	if(value == null || value.length ==0 ){
		alert("please make sure you have selected one record!");
	}else{
		
		if(confirm('Are you sure to delete this record?')){
			window.location.href=value;
		}
		
	}
	
}

function CopyTo(value){
	document.getElementById("alamo").value=value;
}

	/*
function del(direction){
		
	if(confirm("Are you sure to delete it ?")){
		window.location.href=direction;
	}else{
	}
}
*/
function removeProfileConfirm(url){
	
	if(confirm("Are you sure to drop your profile?")){
		window.location.href=url;
	}
}

function removeAccountConfirm(url){
	
	if(confirm("Are you sure to terminate your account?")){
		window.location.href=url;
	}
}

function addfav(){
	if (document.all){
		window.external.AddFavorite("http://www.mightyme.com.au","Welcome to Mighty Me ");
	}
}



function popUpProduct(url){
	window.open(url,"window","height=600, width=500, top=50, left=50, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no , target=_top");
}

function popUpView(url){
	window.open(url,"window","height=700, width=800, top=50, left=50, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no , target=_top");
}

function popUpWindow(url , height , width){
	window.open(url,"window","height="+height+", width="+width+", top=200, left=200, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no , target=_top");
}

function popUpFlirt(url){
	window.open(url,"window","height=200, width=550, top=200, left=200, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no , target=_top");
}

function del(direction, statement){
	if(confirm(statement)){
		window.location.href=direction;
	}else{
	}
}

function pub(direction, statement){
	if(confirm(statement)){
		window.location.href=direction;
	}else{
	}
}

function checkEmailStyle(email){ 
	var i=email.length;
	var temp = email.indexOf('@');
	var tempd = email.indexOf('.');
	if (temp > 1) {
		if ((i-temp) > 3){
			if ((i-tempd)>0){
				return true;
			}
		}
	}
	return false;
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function equals(var1 , var2) {
	if(trim(var1) != null && trim(var2) != null ){
		if(var1 == var2){
			return true;
		}else{
			return false;	
		}
	}else{
		return true;
	}
	
}

/*
 *grab info from www.domania.com
 *v1:url
 *v2:address number
 *v3:address name
 *v4:zip
 *v5:f_tsr_id
 *v6:1:trustee 2:tax
 *
 */
function GrabCompInfo(v1,v2,v3,v4,v5,v6){
	if(v2=="" && v3=="") {
		alert("address is empty,can't grab info.");
	} else if(v4=="") {
		alert("zipcode is empty,can't grab info.");
	}
	var url;
	if(v4 == "" || (v2=="" && v3=="")) {
		alert("Address Empty,Can't grab.");
	} else {
		url=v1+"&f_tsr_address_number="+v2+"&f_tsr_address_name="+v3+"&f_tsr_zip="+v4+"&f_tsr_id="+v5+"&f_tsr_type="+v6;
		window.open(url,"_blank");
	}
	
}
//-->