function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=2,location=0,statusbar=1,menubar=0,resizable=0,width=750,height=525,left = 100,top = 134');");
}

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.main_ad_image.src = imgOn;
}
}

function doMedia(mediaName) {
if (ns3up || ie4up) {
mediaOn = ("" + mediaName);
document.main_ad_media.src = mediaOn;
}
}

function nonetext(q1,q2) {
 var on1 = document.getElementById(q1);
 var on2 = document.getElementById(q2);
 
 if(on1.value != '') on2.disabled= false;
 else {on2.disabled= true;}
}

function imgopen(shir,bis,name) {
	var win = window.open('http://vl-k.ru/img/' + name,'newimg','height='+bis+',width='+shir+'');
}

function dinp(forms,submits) {

  var fo = document.getElementById(forms);
  var po = document.getElementById(submits);
   
   if(fo.submit) {
   po.disabled = true;
 }
}

//-----------
function rmmenu(id) {

 var boxdel = $('#memIdas');
	
 $('#rmmem').click(function(){
	
	if(boxdel.text() != '') {		
		
		boxdel.html('');		
		
		//id = null;
		coon('ok',id);
		img_chang('#meidimag', 'right_array.gif');
		
	} else {
		
		coon('now',id);
		img_chang('#meidimag', 'right_array_down.gif');
	}
	
 });
}
function coon(par,id) {
	
	$.get('http://vl-k.ru/js/menu.php', {hidden: par, ups: id}, function(data){

		if(data != 'true' && id != null) $('#memIdas').html(data);
		
		if(data != 'true' && id == null) $('#ciddel').html(data);
	});

}
//-------------------

function catmen() {
	
	$('#rmcat').click(function(){
		
		var id = null;
		
		if($('#ciddel').text() != '') {		
		
			$('#ciddel').html('');

			coon('nocat',id);
			img_chang('#rightimg', 'right_array.gif');
		
		} else {
			
			coon('okcat',id);
			img_chang('#rightimg', 'right_array_down.gif');
		}
		
	});
}

function img_chang(id, type) {
	
	$(id).attr('src','http://vl-k.ru/images/'+type+'');
}