
function hide(id) {
	$(id).style.display = 'none';
};

function show(id) {
	$(id).style.display = 'block';
};

function remove(id) {
	$(id).innerHTML = '';
};

Array.find = function(ary, element){
    for(var i=0; i<ary.length; i++){
        if(ary[i] == element){
            return i;
        }
    }
    return -1;
}

//---popup---/
function popupPic(sPicURL) {
	var c = encodeURIComponent(sPicURL)
 var l = eval(screen.width/2 - 320);
 var t = eval(screen.height/2 - 240);
 var data = "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=1,directories=no,location=no,width=200,height=200,left="+l+",top="+t;
 window.open("/popup?"+c, "", data);
}
//*********


function makeHomepage(el) {
	if  (navigator.userAgent.indexOf("MSIE")!=-1) {	
		el.style.behavior = 'url(#default#homepage)'; el.setHomePage('http://www.bizness.lv');
		}  
	else {  
		alert('Sorry! This function will not work with non-IE browsers. To make YOURSITENAME your homepage just drag the URL from your URL box to your HOME icon.');
	 }
 }

 /*
//---checkbox replace---
//global variables that can be used by ALL the function son this page.
var inputs;
var imgFalseCheckbox = '/img/checkbox.gif';
var imgTrueCheckbox = '/img/checkbox_active.gif';
var imgFalseRadio = '/img/radio.gif';
var imgTrueRadio = '/img/radio_active.gif';

//this function runs when the page is loaded, put all your other onload stuff in here too.
function init() {
	replaceForms();
}

function replaceForms() {
	
	//get all the input fields on the page
	inputs = document.getElementsByTagName('input');

	//cycle trough the input fields
	for(var i=0; i < inputs.length; i++) {

		//check if the input is a checkbox
		if(inputs[i].getAttribute('type') == 'checkbox') {
			
			//create a new image
			var img = document.createElement('img');
			
			//check if the checkbox is checked
			if(inputs[i].checked) {
				img.src = imgTrueCheckbox;
			} else {
				img.src = imgFalseCheckbox;
			}

			//set image ID and onclick action
			img.id = 'checkImage'+i;
			//set image 
			img.onclick = new Function('checkChange('+i+')');
			//place image in front of the checkbox
			inputs[i].parentNode.insertBefore(img, inputs[i]);
			
			//hide the checkbox
			inputs[i].style.display='none';
		}
		//alert(inputs[i].getAttribute('type'))
		//check if the input is a checkbox

	}
}



//change the checkbox status and the replacement image
function checkChange(i) {

	if(inputs[i].checked) {
		inputs[i].checked = '';
		document.getElementById('checkImage'+i).src=imgFalseCheckbox;
	} else {
		inputs[i].checked = 'checked';
		document.getElementById('checkImage'+i).src=imgTrueCheckbox;
	}
}

function checkChangeRadio(i) {
	if(inputs[i].checked) {
		inputs[i].checked = '';
		document.getElementById('checkImage'+i).src=imgFalseRadio;
	} else {
		inputs[i].checked = 'checked';
		document.getElementById('checkImage'+i).src=imgTrueRadio;
	}
}

window.onload = init;
*/
//---end of checkbox replace---
