//www.kosyellowpages.com
//webmaster@kosyellowpages.com

function MM_reloadPage(init) { 
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function fshehstatusbarin(){
window.status='Done'
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=fshehstatusbarin
document.onmouseout=fshehstatusbarin


function isArray(com) {
	if (typeof(com.length) == "undefined") {
		return false;
	}
	else {
		return true;
	}
}

function isArraySelectBox(com) {
	if (typeof(com[0].length) == "undefined") {
		return false;
	}
	else {
		return true;
	}
}

function trim(str) {
	var strTrim = "";
	var i, j;
	
	if (isEmpty(str)) return strTrim;
	
	for (i=0; i<str.length; i++) {
		if (str.charAt(i) != " ") break;
	}
	for (j=str.length-1; j>=0; j--) {
		if (str.charAt(j) != " ") break;
	}
	
	strTrim = str.substr(i, j-i+1);
	return strTrim;
}

function isEmpty(str) {
	return ((str==null) || (str.length==0));
}

function isWhiteSpace(str) {
	return isEmpty(trim(str));
}

function isDigit(d) {
	return ((d >= "0") && (d <= "9"));
}

function isLetter(c) {
	return (((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")));
}

function isNumeric(strNum) {
	var i;
	
	if (isWhiteSpace(strNum) == true) {
		return false;
	}
	
	strNum = trim(strNum);
	
	for (i=0; i<strNum.length; i++) {
		var chr = strNum.charAt(i);
		if (!isDigit(chr)) {
			return false;
		}
	}
	return true;
}
function isInteger(s)
{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return false;
       else return (isInteger.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    // All characters are numbers.
    return true;
}

function isAlphaNumeric(strNum) {
	var i;
	
	if (isWhiteSpace(strNum) == true) {
		return false;
	}
	
	strNum = trim(strNum);
	
	for (i=0; i<strNum.length; i++) {
		var chr = strNum.charAt(i);
		if (!isDigit(chr) && !isLetter(chr)) {
			return false;
		}
	}
	return true;
}

function isAlphaOnly(strNum) {
	var i;
	
	if (isWhiteSpace(strNum) == true) {
		return false;
	}
	
	strNum = trim(strNum);
	
	for (i=0; i<strNum.length; i++) {
		var chr = strNum.charAt(i);
		if (!isLetter(chr)) {
			return false;
		}
	}
	return true;
}

function isRange(formObj, min, max)
{
	if(formObj.length < min || formObj.length > max)
	{
		return false;
	}
	return true;
}


function isEmail(s)
{   
	
	//alert(s); 
   	// is s whitespace?
    //if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++;
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++;
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else
	return true;
}

//Function to check whether the string is a valid integer
//Function to check whether the zipcode is a valid US zip code
function isZIPCode(field) 
{
	var valid = "0123456789";
	var hyphencount = 0;
	
	if (field.length!=5) {
	alert("Please enter your 5 digit zip code.");
	return false;
	}
	for (var i=0; i < field.length; i++) {
	temp = "" + field.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") {
	alert("Invalid characters in your zip code.  Please try again.");
	return false;
	}

	}
	return true;
}

function isMoney(str) 
{
	var valid = "0123456789.-"
	var temp;
	for (var i=0; i<str.length; i++) {
		temp = "" + str.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") 
			//ok = "no";
			return false;
	}
	return true;
}

function isPhoneNumber(str) 
{
	var valid = "0123456789()-"
	var temp;
	for (var i=0; i<str.length; i++) {
		temp = "" + str.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") 
			//ok = "no";
			return false;
	}
	return true;
}

function isCheckedRadio(objRadio) {
	checked = false;
	if (objRadio) {
		count = objRadio.length;
		if(count == 1) {
			checked = objRadio.checked;
		} 
		else {
			for(var i=0; i<count; i++) {
				if(objRadio[i].checked) {
					checked = true;
				}
			}
		}
	}
	return checked;
}

function getRadioVal(objRadio) {
	checked = false;
	if (objRadio) {
		count = objRadio.length;
		if(count == 1) {
			checked = objRadio.value;
		} 
		else {
			for(var i=0; i<count; i++) {
				if(objRadio[i].checked) {
					checked = objRadio[i].value;
				}
			}
		}
	}
	return checked;
}


function isSelected(frmObjSelect)
{
	if (frmObjSelect.value == -1) {
		return false;
	}
	else {
		return true;
	}
}



/* custom function for kosova-yp.com */
function toggle_over(el) {
	for(i=1; i<=11; i++) {
		eval("submenu"+i+".style").display = 'none';	
	}		
	el.style.display = '';
}
function toggle_out(el) {
	for(i=1; i<=11; i++) {
		eval("submenu"+i+".style").display = 'none';	
	}
	el.style.display = '';
}
function toggle_action(el) {
	if(el.style.display == '') {
		el.style.display = 'none';	
	} else {
		el.style.display = '';
	}
}

function popupWindow(page_url, width, height, opt) {
	popup_window = window.open(page_url,'popup_window','width='+width+',height='+height+','+opt);
	popup_window.focus();
}

function printWindow(page_url,width,height) {
	print_window = window.open(page_url,'popup_window','width='+width+',height='+height+',toolbar=0,location=0,directories=0,resizable=0,status=0,menubar=0,scrollbars=1');
	print_window.focus();
}


function imageWindow(boardname,id,width,height) {
	image_window = window.open('image_viewer1330.html?board='+boardname+'&id='+id,'image_window','width='+width+',height='+height+',toolbar=0,location=0,directories=0,resizable=0,status=0,menubar=0,scrollbars=1');
	image_window.focus();
}

