
function isdefined( variable){
    return (typeof(window[variable]) == "undefined")?  false: true;
}



function openWindow(address, w, h, t,l){
	myWin = window.open( ""+address , "win"+w+h ,"scrollbars=yes, resizable=yes, width="+w+", height="+h+", top="+t+", left="+l+" ");
}



function popup(what, w, h){
	config='toolbar=no,location=no,directories=no,stat us=no,menubar=no,width='+w+',height='+h+''
	config += 'scrollbars=no,resizable=no'
	pop = window.open ("","pop",config)

	pop.document.write('<html><head></head><body style="margin: 0; padding: 0;">');
	pop.document.write('<img src="'+what+'" onclick="javascript:self.close()" />');
	pop.document.write('</body></html>');
	
	//return true;
}

function findPos(id) {
	var curleft = curtop = 0;
	
	obj = document.getElementById(id);
	
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


function tooltip(txt, id){
	TagToTip(txt, BALLOON, true, ABOVE, true, OFFSETX, 0,  TEXTALIGN, 'justify', FADEIN, 300, FADEOUT, 300, PADDING, 0, BALLOONIMGPATH, 'js/tip/tip_balloon/', FIX, findPos(id));
}

function easytip(id_text_holder){
	TagToTip(id_text_holder, ABOVE, true, OFFSETX, -0, BALLOON, true, FADEIN, 400, FADEOUT, 400, BALLOONIMGPATH, 'js/tip/tip_balloon/');
}

function GoToPage(location)
{
    document.location  = location;
}

function ConfirmAct(msg, location)
{
    if (confirm(msg))
    {
        document.location  = location;
    }
}

function SubmitForm(f)
{
    f.submit();
}


