doPrint = function(co)
{
    toPrint("CONDOHOTELS", document.getElementById(co).innerHTML);
}

toPrint = function(title, content)
{
    content = content.replace('display: block','display: none');
    
    NewWindow=window.open("", "","width=800,height=600,toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=yes,resizable=no,fullscreen=no");
    NewWindow.document.open();

    NewWindow.document.writeln("<html>\n<head>\n</head>");
    NewWindow.document.writeln("<body leftmargin=10 topmargin=10 scroll=yes style=\"background-color:#ffffff; font-family: verdana; font-size: 11px;\" onload=\"print();\">");
    NewWindow.document.writeln("<title>"+ title +"</title>");
    NewWindow.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"templates/default/style/style.css\">")
    NewWindow.document.writeln("<style>");
    NewWindow.document.writeln("img { border: none; } table { font-family: arial; font-size: 11px; }");
    NewWindow.document.writeln("</style>");
    NewWindow.document.writeln("<table width=\"100%\"><tr><td>&nbsp;</td></tr><tr><td style=\"text-align: justify;\">");
    NewWindow.document.writeln(content);    
    NewWindow.document.writeln("</td></tr></table>");
    NewWindow.document.writeln("<br><br><hr size=\"1\" color=\"#e0e0e0\" style=\"background-color: #e0e0e0; width: 100%; height: 1px;\">");
    NewWindow.document.writeln("<table width=\"100%\"><tr><td>&copy; CONDOHOTELS.</td></tr></table>");
    NewWindow.document.writeln("</body>\n</html>\n");
    NewWindow.document.close();
    NewWindow.focus();
}

function flash(w, h, path)
{ 
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="qashqai" align="middle">'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<param name="movie" value="'+path+'" />'
	+'<param name="menu" value="false" />'
	+'<param name="quality" value="best" />'
	+'<param name="wmode" value="opaque" />'
	+'<embed src="'+path+'" menu="false" quality="best" wmode="opaque" bgcolor="#ffffff" width="'+w+'" height="'+h+'" name="qashqai" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	+'</object>');
}

function flash2(w, h, path)
{ 
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="qashqai" align="middle">'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<param name="movie" value="'+path+'" />'
	+'<param name="menu" value="false" />'
	+'<param name="quality" value="best" />'
	+'<param name="wmode" value="opaque" />'
	+'<param name="bgcolor" value="#000000">'
	+'<embed src="'+path+'" menu="false" quality="best" wmode="opaque" bgcolor="#000000" width="'+w+'" height="'+h+'" name="qashqai" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	+'</object>');
}

function MenuOn(source)
{
	var image = source.src;
	var exp = image.split("/");
	var key = exp.length - 1;
	
	source.src = 'templates/default/img/'+exp[key]+'&c=1';
}
function MenuOff(source)
{
	var image = source.src;
	var exp = image.split("/");
	var key = exp.length - 1;
	
	var bsp = exp[key].split("&");
	
	source.src = 'templates/default/img/'+bsp[0];
}
function showPhoto(id, foto)
{
	advAJAX.setDefaultParameters({
              onInitialization : function(obj) { document.getElementById(obj.tag).innerHTML = "Preparing..."; },
              onLoading : function(obj) { document.getElementById(obj.tag).innerHTML = '<div class=\"ajax_loader\"><img src="templates/wojcik/images/loader.gif"><br>Wczytywanie zdj�cia</div>'; },
              onSuccess : function(obj) { 
			  
			  	//var re = new RegExp('[^<]*<!', "gi");
	//var atxt = obj.responseText.match(re);
	//var conv = atxt.substring(0,-2);
	//var temp = new Array();
	//temp = atxt.split('@');
	//alert(temp[0]);
			  
			  //document.getElementById(obj.tag).innerHTML = '<img src="?mod=prod&act=generate&f='+foto+'_midi.jpg" border="0" style="padding: 2px; border: 1px solid #ffffff;"><br><br>';
			  document.getElementById(obj.tag).innerHTML = obj.responseText;
			  },
              onError : function(obj) { document.getElementById(obj.tag).innerHTML = "Error..."; }
            });
            advAJAX.get({ url: "?mod=projects&id="+id+"&photo="+foto, tag: "PhotoBox" });
            advAJAX.setDefaultParameters({});
}

function Zoom(link, w, h)
{
	window.open(link, '', 'width='+w+',height='+h+',scrollbars=no,toolbars=no');
}

function popupGallery(link, w, h)
{
	window.open(link, '', 'width='+w+',height='+h+',scrollbars=no,toolbars=no');
}

function showErrorBack(msg, val, link)
{
	val++;
	document.getElementById('error_msg_container').style.display = 'block';
	document.getElementById('errmsg').innerHTML = msg;
	showCountdown2(val, link);
}

function showCountdown2(value, link)
{
	sec = value - 1;
	rlink = link;
	document.getElementById('countdown').innerHTML = sec;
	if(sec != 0)
	{
		var down = window.setTimeout("showCountdown2(sec, rlink)", 1000);
	}
	else
	{
	document.location.href = link;
	}
}

clearField = function(obj){
	if (obj.value == 'e-mail ...') {
	obj.value = '';
	}
}
