// javascript common loaded file

		flash = 0
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) ?
		navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >=5) {
			flash = 1;
		}

function getXML(){
	if (event.ctrlKey && event.keyCode==88){
 		window.event.cancelBubble = true;
 		location_xml();
 	}
}

function location_xml (cl,i) {
	cl = document.location.href
	i = cl.indexOf('#')
	if ( i != -1  ){
		cl=cl.substring(0,cl.indexOf('#'));
	}
	cl += ( cl.indexOf('?') !=-1 ) ?  '&_xml' : '?&_xml'
	document.location=cl
}

document.onkeyup = mykeys

function mykeys(){
	getXML();
}

function wfloat (target,size) {
	var size = size || 'width=530,height=445'
	var target = target || 'wfloat';
	openwnd ('',target,size);
}

function wfloatbig (target,size) {
	//var size = size || 'width=736,height=610,menubar=yes,scrollbars=yes,status=no'
	var size = size || 'width=837,height=610,menubar=yes,scrollbars=yes,status=no'
	var target = target || 'wfloatbig';
	openwnd ('',target,size);
}

function OpenWindowDiplom (url,target) {
	wnd = null;
	var url = url || '';
	var size = 'width=619,height=620';
	var target = target || 'wfloat';
	wnd = window.openwnd (url,target,size+'toolbar=no,menubar=yes,scrollbars=yes,status=no');
	wnd.document.open();
	wnd.document.write("<html><head><title>Увеличенное изображение</title></head><body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><img src='"+url+"' border='0' vspace='0' hspace='0'/><body></html>");
  wnd.document.close();

}



var LinkDivActive = 0;
var onDiv;
var timeOnDiv;
var layerRef;
var styleRef;
var showVar;
var hideVar;

if (navigator.appName == "Netscape") {
 layerRef="document.";
 styleRef="";
 showVar="'show'";
 hideVar="'hide'";
} else {
 layerRef="document.all.";
 styleRef=".style";
 showVar="'visible'";
 hideVar="'hidden'";
}

function hideDiv(divn) 
{
	document.getElementById(divn).style.display='none';
// eval(layerRef+divn+styleRef+'.visibility = '+hideVar);
}

function showDiv(divn) 
{
	document.getElementById(divn).style.display='block';
//	if(window.screen.width > 1024) document.getElementById(divn).style.width='250px';
// eval(layerRef+divn+styleRef+'.visibility = '+showVar);
}

function showLinkDiv(divn) {
 if (timeOnDiv != null) {
  clearTimeout(timeOnDiv);
  hideDiv(onDiv);
 }
 showDiv(divn);
 onDiv = divn;
}

function divTimer() {
 timeOnDiv = setTimeout("divOut()",5500)
}

function divOut() {
 if (LinkDivActive == 0) {
  hideDiv(onDiv);
 }
}

function LinkDivOver() {
 LinkDivActive = 1;
 clearTimeout(timeOnDiv);
}

function LinkDivOut() {
 LinkDivActive = 0;
 timeOnDiv = setTimeout("divOut()",1000)
}


wnd = null;

function showmap (id, dim) {
	 self.name = 'MAIN';
	 var url = '/showmap.xgi?'+id,
		 w = dim ? dim[0] : 500,
		 h = dim ? dim[1] : 286;
	 if(!wnd || wnd.closed) wnd = openwnd (url, 'modificationinfo','scrollbars=no,status=no,resizable=no,width=' + w + ',height=' + h);
   else{
     if(wnd.location.pathname+wnd.location.search!=url) wnd.location=url
     wnd.focus()
   }
   return false
}

function showvmap (id) {
	 self.name = 'MAIN';
	 var url = '/showmap.xgi?'+id;
	 if(!wnd || wnd.closed) wnd = openwnd (url, 'modificationinfo','scrollbars=no,status=no,resizable=no,width=356,height=500');
   else{
     if(wnd.location.pathname+wnd.location.search!=url) wnd.location=url
     wnd.focus()
   }
   return false
}

function flatpress (query) {
	 self.name = 'MAIN';
	 var url = '/newbuild/flat-press.xgi?'+query;
	 if(!wnd || wnd.closed) wnd = openwnd (url, 'flatpress','scrollbars=yes,status=no,resizable=no,width=600,height=513');
   else{
     if(wnd.location.pathname+wnd.location.search!=url) wnd.location=url
     wnd.focus()
   }
   return false
}

function buildpress (query) {
	 self.name = 'MAIN';
	 var url = '/newbuild/build-press.xgi?'+query;
	 if(!wnd || wnd.closed) wnd = openwnd (url, 'flatpress','scrollbars=yes,status=no,resizable=no,width=600,height=513');
   else{
     if(wnd.location.pathname+wnd.location.search!=url) wnd.location=url
     wnd.focus()
   }
   return false
}

function viewphoto (id) {
	 self.name = 'MAIN';
	 var url = '/viewphoto.xgi?&image_id='+id;
	 if(!wnd || wnd.closed) wnd = openwnd (url, 'viewphoto','scrollbars=no,status=no,resizable=no,width=300,height=250');
   else{
     if(wnd.location.pathname+wnd.location.search!=url) wnd.location=url
     wnd.focus()
   }
   return false
}

function additionalStyles() {
	if ( screen.width<1000 ) {
		document.write('<LINK href="/styles/800.css" rel="stylesheet"  type="text/css">');
		alert('!!!')
	}
}


function CheckVoting(id)
{
	oCookie=getCookie('question');
	if(oCookie==id)
	{
		alert("Вы уже принимали участие в этом голосовании!");
		return false;
	}
	else
	{
		setCookie('question', id, -1, '/');
		return true;
	}
}

function ShowThis(divid) {
	if (document.getElementById(divid).style.display=="none") {
		document.getElementById(divid).style.display="block";
	} else {
		document.getElementById(divid).style.display="none";
	}
}

function ShowThisBody(divid) {
	document.getElementById(divid).style.display="block";
}

function HideThis(divid) {
	document.getElementById(divid).style.display="none";
}


$(function() {

$('#promo').corner("round 8px").parent().css('padding', '2px').corner("round 10px")

})


