var cur_p1=0;
var cur_p2=0;

    // convert all characters to lowercase to simplify testing

    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
    var is_opera = (window.opera)?true:false;
    var is_opera7 = (window.opera)?true:false;
    var is_gecko = (agt.indexOf('gecko') != -1);


if(document.all && !document.getElementById)
    document.getElementById = function(id) { return document.all[id]; }

if(document.all && !document.getElementsByTagName)
    document.getElementsByTagName = function(tag) { return document.all.tags(tag); }


var lo = 1;
function sof (a) {
	if (document.getElementById('foto' + lo)) document.getElementById('foto' + lo).style.display = 'none';
	document.getElementById('oferta' + lo).style.display = 'none';
	document.getElementById('lin' + lo).className = '';
	lo = a;
	if (document.getElementById('foto' + lo)) document.getElementById('foto' + lo).style.display = '';
	document.getElementById('oferta' + lo).style.display = '';
	document.getElementById('lin' + lo).className = 'selected';

}

function footReset() {
	f = document.getElementById('footer').style.position="relative";
	f = document.getElementById('footer').style.position="absolute";
	//alert('test');
	if (txtalert != '') {
		alert(txtalert);
		txtalert = '';
	}
}


function flash(name,src,x,y,ver,opcja) {
	

	if (opcja == 'w3c') {
		document.write ('<object id="'+name+'" type="application/x-shockwave-flash" data="'+src+'" width="'+x+'" height="'+y+'" >');
		document.write ('<param name="movie" value="'+src+'" >');
		document.write ('<param name="swliveconnect" value="true">');
		document.write ('</object>');
	}
	else {

		document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write ('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ver+',0,0,0"');
		document.write ('width='+x+' height='+y+' id="'+name+'">');
		document.write ('<param name=movie value="'+src+'">');
		document.write ('<param name=quality value=high>');

		if (opcja == 'transparent') document.write ('<param name="wmode" value="transparent">');

		document.write ('<param name="swliveconnect" value="true">');
		document.write ('<embed src="'+src+'" quality="high" width="'+x+'" height="'+y+'"');
		document.write (' type="application/x-shockwave-flash"');
		document.write (' pluginspage="http://www.macromedia.com/downloads/"');
		document.write (' name="'+name+'" swliveconnect="true">');
		document.write ('</embed>');
		document.write ('</object>');
	}
}



var lastWin;
function setImg (imgSrc,reSize) {
	if (lastWin.jestem) {
		
		if (reSize == 1) {
			lastWin.document.body.innerHTML = '<img src="'+imgSrc+'" id="obrazek" onload="window.resizeTo(this.width + 10,this.height + 30);window.moveTo(20,20);" >'; 
			lastWin.focus();
		}
		else {
			lastWin.document.body.innerHTML = '<img src="'+imgSrc+'" id="obrazek" >'; 
		}
			
	}	
	else {
		setTimeout("setImg('"+imgSrc+"', '"+reSize+"')",100);
	}
}


function setSizeImg () {
	if (lastWin.document.getElementById('obrazek')) {

	//	lastWin.resizeTo(lastWin.document.getElementById('obrazek').width + 10,lastWin.document.getElementById('obrazek').height + 30);
	//	lastWin.moveTo(20,20); 
		alert(lastWin.document.getElementById('obrazek').src);
		lastWin.close(); 
		zoomImg(lastWin.document.getElementById('obrazek').src,lastWin.document.getElementById('obrazek').width,lastWin.document.getElementById('obrazek').height);
	}	
	else {
		setTimeout("setSizeImg()",100);
	}
}

// onload="window.resizeTo(this.width + 10,this.height + 30);window.moveTo(20,20);

function zoomImg(imgSrc,xSize,ySize) {
	reSize = 1;
	if (xSize && ySize) reSize = 0;
	if (!xSize) xSize=300;
	if (!ySize) ySize=300;
	scrollBary='no';
	xPos=20;
	lastWin = window.open('','Zoom', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollBary+',resizable=yes,fullscreen=no,channelmode=no,width='+xSize+',height='+ySize+',top=0,left='+xPos);
	
	setImg (imgSrc,reSize);
	void(0);
}
function zoom2(imgSrc) {
	lastWin = window.open('sdgsdgsd','zoomOkno','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,fullscreen=no,channelmode=no,width=300,height=300,top=0,left=150');

	void(0);
}

function oW (path,Xsiz,Ysiz,Xp,Yp,resi,scrollb) {
	if (path.indexOf('zoom.php') != -1) path = '/heuristic2/'+path;
	var przed = '';
	if (!(Xsiz > 0)) { Xsiz = 300; }
	if (!(Ysiz > 0)) { Ysiz = 300; }
	if (Xp == 'right') Xp = screen.width - 20 - Xsiz;
	if (!(Xp > 0)) { Xp = 30; }
	if (!(Yp > 0)) { Yp = 30; }
	if (resi == null) resi = 'yes';
	if (scrollb == null) scrollb = 'yes';
	var w = window.open(przed+path, 'fotozoom', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollb+',resizable='+resi+',fullscreen=no,channelmode=no,width='+Xsiz+',height='+Ysiz+',top='+Yp+',left='+Xp);
	w.focus();
	void(0);
}

function el (id) {
        return document.getElementById(id);
}

function tf (txt,id) {
		if (el(id).value == '') {
	        alert(txt);
			el(id).focus();
			return false;
		}
		else return true;
}

function ts (txt,id) {
		if (el(id).selectedIndex == 0) {
	        alert(txt);
			el(id).focus();
			return false;
		}
		else return true;
}

function te (txt,id) {
		if (el(id).value != '' && el(id).match(/^.*\@.*\..*$/)==null) {
	        alert(txt);
			el(id).focus();
			return false;
		}
		else return true;
}

function tc (txt,id) {
		if (!(el(id).checked)) {
		
	        if (txt != '') { alert(txt); el(id).focus(); }
			return false;
		}
		else return true;
}



function pobierz(nazwa) {
    if (document.cookie.length > 0) {
        startc = document.cookie.indexOf(nazwa + "=");
        if (startc != -1) {
            startc += nazwa.length + 1;
            endc = document.cookie.indexOf(";", startc);
            if (endc == -1) {
                endc = document.cookie.length;
            }
            return unescape(document.cookie.substring(startc,endc));
        }
	return false;
    }
    return false;
}

function rejestruj(nazwa, wartosc,dni) {
    var dzisiaj=new Date();
    var wygasnie=new Date();
    !dni ?dni=7 :"";
    // dni - data po kt�rej ciastko traci wa?no?a (domy?lnie tydzien)
    // je?li dni==0 to wa?ne w ci1gu danej "sesji"
    wygasnie.setTime(dzisiaj.getTime()+1000*60*60*24*dni);
	document.cookie=nazwa+"="+escape(wartosc)+";expires="+wygasnie.toGMTString();
}

function sClear(obj,itxt) {
	if (obj.value == itxt) obj.value = '';
}
function sReturn(obj,itxt) {
	if (obj.value == '') obj.value = itxt;
}


// **************** MENU *******************

var activeSubMenu = false;
var timeOut = 1000;

$(document).ready(function(){
	$('#menu ul li a.menu').mouseover(function(){subMenu($(this).get(0), 1);});
	$('#menu ul li a.menu').mouseout(function(){subMenu($(this).get(0), 0);});
	$('#menu ul li ul.submenu').mouseover(function(){overMenu($(this).get(0));
							 if($(this).parent().attr('class') != 'selected')
							 {
							 	$(this).parent().addClass('selected2');
							 }});
	$('#menu ul li ul.submenu').mouseout(function(){outMenu($(this).get(0));
							if($(this).parent().attr('class') != 'selected')
							{
								$(this).parent().removeClass('selected2');
							}});
});

function subMenu(obj,show)
{
  if(obj.nextSibling)
  {
    if(obj.nextSibling.innerHTML)
    {
      activeSubMenu = t = obj.nextSibling;	

      if (show)
      {
	allul = document.getElementsByTagName('ul');
	for (a = 0; a < allul.length; ++a) if (allul[a].className == 'submenu') allul[a].style.visibility = 'hidden';
	t.style.visibility = 'visible';
      }
      else
      {
        activeSubMenu = false;
	setTimeout ("hideSubmenu(document.getElementById('"+t.id+"'))",timeOut);
      }
    }
  }
}

function hideSubmenu(t) {
	if (!activeSubMenu || activeSubMenu != t) t.style.visibility = 'hidden';
}

function overMenu(t) {
	activeSubMenu = t;
}

function outMenu(t) {
	activeSubMenu = false;
 	setTimeout ("hideSubmenu(document.getElementById('"+t.id+"'))",timeOut);
}

function addslashes(str) {
	str=str.replace(/\'/g,'\\\'');
	str=str.replace(/\"/g,'\\"');
	str=str.replace(/\\/g,'\\\\');
	str=str.replace(/\0/g,'\\0');
	return str;
}
function stripslashes(str) {
	str=str.replace(/\\'/g,'\'');
	str=str.replace(/\\"/g,'"');
	str=str.replace(/\\\\/g,'\\');
	str=str.replace(/\\0/g,'\0');
	return str;
}

function emailValid(t,im,em) {
	
	var imie = document.getElementById('newsImieF');
	var mail = document.getElementById('newsEmailF');
	var er = document.getElementById('newsEmailI');
	
	try{
	if (!imie.value) {
		er.innerHTML = im;
		mail.focus(); 
		mail.parentNode.parentNode.className = 'alertRow';
		return false;
	}
	else {
		if (mail.value.indexOf('@',0) == -1 || mail.value.indexOf('.',0) == -1){
			er.innerHTML = em;
			mail.focus(); 
			mail.parentNode.parentNode.className = 'alertRow';
			return false;
		}
	}
	}
	catch(e){}
}

function emailPassValid(t,g) {
	
	var email = document.getElementById('emailF');
	var eror = document.getElementById('emailI');
	
	try{
	if (email.value.indexOf('@',0) == -1 || email.value.indexOf('.',0) == -1){
		eror.innerHTML = g;
		email.focus(); 
		email.parentNode.parentNode.className = 'alertRow';
		return false;
	}
	}catch(e){}
}


function prints(a) {


	var links = document.location.href;
	if(links.indexOf('#') != -1) {
		links=document.location.href.substring(0,links.indexOf('#'));

	}

	if(links[links.length-1] != '/') {
		links = links+'&print=1';
	}
	else {
		links = links+'page.php?print=1';
	}

	oW(links,740,740);

}


// **************** JQUERY *******************

$(document).ready( function(){

	// mp3 player
        $('img.actItemMp3').each(function(){

               if (this.alt != '') {
                       $(this).after('<object type="application/x-shockwave-flash" style="width: ' + this.width + 'px; height:' + this.height + 'px;" data="/mp3player.swf?mp3file=' + this.alt + '&txt=' + this.title + '"><param name="movie" value="/mp3player.swf?mp3file=' + this.alt + '&txt=' + this.title + '"/><param name="wmode" value="transparent" /></object>');
               }
        });
        $('img.actItemMp3').remove();


	// youtube player
        $('img.actItemYoutube').each(function(){

		if (this.alt != '') {
			$(this).after('<object type="application/x-shockwave-flash" style="width: ' + this.width + 'px; height:' + this.height + 'px;" data="' + this.alt + '"><param name="movie" value="' + this.alt + '" /><param name="wmode" value="transparent" /></object>');
		}		
	});
	$('img.actItemYoutube').remove();


	// last gallery
	$('.last_gallery').cycle({fx: 'fade',
		                       speed: 300,
	        	               timeout: 5000});




});





// ********************* KORKITV.TV *************************




function load_video_lekcja(inp_code, id)
{

	$.get('/services/getvideo.php', { code : inp_code, id : id }, function(data) {
		$('#videoLekcjeVideo').html(data);

	});
}


function dark_box(state)
{
	if(state==true)
	{
		$('#darkBox').css('top', $(window).scrollTop()+'px');
		$('#darkBoxContent').css('top', $(window).scrollTop()+'px');
		$('body').css('overflow', 'hidden');
		$('#darkBox').css('display', 'block');
		$('#darkBox').stop().animate({opacity: '0.8'}, 500);
	}
	else
	{
		$('#darkBox').stop().animate({opacity: '0'}, 500, function() {
			$('#darkBox').css('display', 'none');
			$('body').css('overflow', 'auto');
		});
	}

}


function centerDarkBox()
{
	ww=$(window).width();
	wh=$(window).height();
	$('#darkBoxContent').css('left', (ww/2)-($('#darkBoxContent').width()/2)+'px');
	$('#darkBoxContent').css('top', ((wh/2)-($('#darkBoxContent').height()/2)+$(window).scrollTop())+'px');

}


$(document).ready(function() {
	


	// ******** wyniki wyszukiwania z wybranym przedmiotem


	$('#korsearch').submit(function() {
		if($('#przedmlok').val()=='(miejscowość)')
		{
			$('#przedmlok').val('');
		}
		return true;
	});

	$('.przednow').click(function() {
		var tmp=$(this).attr('id').split('_');
		tmp=tmp[1];
		$('#przedmlist option[value='+tmp+']').attr("selected","selected");
		$('#przedmlok').val('');
		$('#korsearch').submit();
	});

	$('.przedsw').click(function() {
		if($(this).html()=='Wszystkie przedmioty')
		{
			$('#przTop').css('display', 'none');
			$('#przAll').css('display', 'block');
			$(this).html('Najpopularniejsze przedmioty');
		}
		else
		{
			$('#przTop').css('display', 'block');
			$('#przAll').css('display', 'none');
			$(this).html('Wszystkie przedmioty');
		}
	});


	// *****************************************************







	
	$('.day').click(
		function(){
			var name = $(this).attr('name');
			if ($(this).is(":checked")){
				$(this).parent().removeClass('inactive').addClass('active');
				//$(this).val('1');
			}else{
				$(this).parent().removeClass('active').addClass('inactive');
				//$(this).val('0');
			}


		}


	);




	// ostatnie profile na glownej
	$('#lastProfilesOuter').cycle({fx: 'scrollHorz',
                    	speed: 500,
                    	timeout: 0,
             		prev: '#lastProfilesPrev',
             		next: '#lastProfilesNext'});





	// menu
	$('#menuBarInner').css('left', ((940-$('#menuBarInner').width())/2)+'px');
	$('#menuBarInner a.off').hover(function() {
		$(this).prev().removeClass('left');
		$(this).prev().addClass('left_sel');
		$(this).next().removeClass('right');
		$(this).next().addClass('right_sel');
	}, function() {
		$(this).prev().removeClass('left_sel');
		$(this).prev().addClass('left');
		$(this).next().removeClass('right_sel');
		$(this).next().addClass('right');
	});




		

	$('.closeUpload').live('click',function() {
		$('#darkBoxContent').css('display', 'none');
		dark_box(false);

	});

	


	$('.addMovie').click(function() {
		dark_box(true);
		$.get('/services/video_upload.php', { mode : 'start' }, function(data) {
			$('#darkBoxContent').html(data);
			centerDarkBox();
			$('#darkBoxContent').css('display', 'block');
		});
	});


	$('.addFoto').click(function() {
		$('body').css('overflow', 'hidden');
		dark_box(true);
		$.get('/services/foto_upload.php', { mode : 'start' }, function(data) {
			$('#darkBoxContent').html(data);
			centerDarkBox();
			$('#darkBoxContent').css('display', 'block');
		});
	});







	// oceny - gwiazdki
	$('.vidRateStars1').mousemove(function(event) {
  		//var msg = 'Handler for .mousemove() called at ' + event.pageX + ', ' + event.pageY;
  		//$('#log').append('<div> + msg + '</div>');
		//alert(event.pageX);
		var mx=event.pageX-$(this).offset().left+5;
		mx=Math.round(mx/18)*18;
		$(this).children().css('width', mx+'px');
	});

	$('.vidRateStars1').hover(function() {

	}, function (){
		$(this).children().css('width', $(this).children().children().next().html()+'px');
	});


	$('.vidRateStars1').click(function() {
		if( !$(this).children().hasClass('locked'))
		{
			var rate=$(this).children().width()/18;
			//alert(rate);
			$('.videoPlayerRate').html('<div style="padding-left: 28px; background: url(/img/layout/ajax_rate.gif) no-repeat 0 2px;" class="vidRateTxt">Proszę czekać...</div>');
			var opts=$(this).children().children().html().split('|');
			$.get('/services/rate.php', {'rate' : rate, 'mode' : opts[0], 'id' : opts[1]}, function(data) {
				var spl=data.split('###');
				if(spl[0]=='LOGIN')
				{
					document.location = '/zaloguj/access,1.html';
				}
				if(spl[0]=='OK')
				{
					var newrate=Math.round(spl[1]*16.8);
					$('.videoPlayerRate').html('<div class="vidRateTxt"> Dodano ocenę! </div><div class="vidRateStars1" ><div class="vidRateStars2" style="width: '+newrate+'px;"></div></div>');
				}			

			});
		}
	});


	/* WIADOMOŚCI *************************************/

	$('.msgDelete_').click(function(){
		var shure = confirm('Czy na pewno chcesz usunąć tą wiadomość');
		if(shure){ 
			$.get('/services/msg_send.php',{id:$(this).attr('id'),mod:'delete'},function(response){
				//alert(response);
			});
			$(this).parent().parent().fadeOut();
		}	
	});

	$('.msgShow_').click(function(){
		var toShow = $(this).attr('id').split('_');
		$.get('/services/msg_send.php',{mode:'read',id:toShow[1]},function(response){
			//alert(response);
		});
		$('#show_'+toShow[1]).toggle();
	
		$('.msgReply_').click(function(){
			$('#msgAnswer_'+toShow[1]).toggle();
		});
		$('#msgAnswer_'+toShow[1]+' form').submit(function(){
			$(this).children('input[name=send]').attr('disabled',true);
			var title = $(this).children('input[name=tytul]').val();
			var msg = $(this).children('textarea[name=message]').val();
			var to = $(this).children('input[name=to]').val();
			var from = $(this).children('input[name=from]').val(); 
			//alert(msg);
			
				$.get('/services/msg_send.php',{tytul:title,msg:msg,to:to,from:from},function(response){
					
					if(response != 'OK'){
						alert(response);
						$(this).children('input[name=send]').attr('disabled',false);
					}else{
						
						$('#msgAnswer_'+toShow[1]).fadeOut();
						
					}
				
				});
			
			
			//alert(title);
			return false;	
		});
	});


	

	
	/* *** WYSLIJ WIADOMOSC *** */
	$('.sendMsg').click(function() {
		dark_box(true);
		$.get('/services/msg_send.php', { mode : 'send' , to : $(this).attr('rel')}, function(data) {
			$('#darkBoxContent').html(data);
			centerDarkBox();
			$('#darkBoxContent').css('display', 'block');
		});
	});

	/* *** LISTA KOR *** */
	$('.addToList').click(function(){
		var kor = $(this).attr('rel');
		$.get('/services/kor_list.php',{mode: 'add', kor: kor},function(response){
			alert(response);
			$(this).fadeOut();
		});
	});
	$('.delFromList').click(function(){
		var kor = $(this).attr('rel');
		$.get('/services/kor_list.php',{mode: 'del', kor: kor},function(response){
			alert(response);
			
		});
	});

	//* *** DODAJ KOMENTARZ *** *//
	$('.addComment').click(function(){
		var id = $(this).attr('rel');
		dark_box(true);
		$.get('/services/comment.php',{mode: 'add', id: id},function(response){
			$('#darkBoxContent').html(response);
			centerDarkBox();
			$('#darkBoxContent').css('display', 'block');
			
		});
		
	});

	


});

function changer(pid,cat,firstLoad){
	if(firstLoad){
		$('#videoMatematyka_ a').css({background: 'url(/img/layout/videolist_crn.jpg) no-repeat scroll 0  0'});
		$('#videoFizyka_ a').css({background: 'url(/img/layout/videolist_crn2.jpg) no-repeat scroll 0  0'});	
		$('#videoChemia_ a').css({background: 'url(/img/layout/videolist_crn1.jpg) no-repeat scroll 0  0'});
	}
	$('#loadingOudput').show();
	$.get('/page.php?cat=104',{p1:pid,p2:cat},function(data){
		$('#loadingOudput').hide();
		$('#oudput').html(data);
	});	         
}





var buffer='';

function toggle_video(path)
{

	
	$('#bigContent').toggle('slow', function() {
		$('#videoPlayerProfile').toggle("slow");
	});

}






$(document).ready(function() {

	$('#form_korsort').submit(function() {
		var v=$('#korsortuj').val();

		if($('#korrm').val()=='')
		{
			if(v==8) $('#korrm').val(1);
			if(v==20) $('#korrm').val(1);
			if(v==14) $('#korrm').val(0);
		}

		if (v==20)
		{
			if($('#korrm').val()==0)
			{
				$('#korrm').val(1);	
			}
			else
			{
				$('#korrm').val(0);
			}
		}

	


			return true;
	});


	$('.profileBack').live('click',function () {
		var tmp=$('#videoPlayerProfile .video').html();
		$('#videoPlayerProfile .video').html('');
		$('#videoPlayerProfile .video').html(tmp);
		$('#videoPlayerProfile').toggle("slow", function() {
			$('#bigContent').toggle('slow');
		});
	});


	$('#form_korsort').submit(function() {
		var link='/korepetytorzy/order,'+$('#korsortuj').val();
		var xtra='';
//alert($('#tmpWyniki').html());
		if ($('#tmpWyniki').html()!='')
		{
			xtra=',wyniki,'+$('#tmpWyniki').html();
		}
		if($('#korrm').val()==1)
		{
			link=link+',asc,1'+xtra+'.html#korres';
		}
		else
		{
			link=link+',desc,1'+xtra+'.html#korres';
		}
		window.location=link;
		return false;
	});


	$('#infows').click(function() {
		if($(this).html()=='Opis lekcji' || $(this).html()=='Opis filmu')
		{
			$(this).attr('tag', $(this).html());
			$(this).html('Film');
			$('#videoLekcjeInformacje').css('display', 'block');
			$('#videoLekcjeVideo').css('display', 'none');
		}
		else
		{
			$(this).html($(this).attr('tag'));
			$('#videoLekcjeInformacje').css('display', 'none');
			$('#videoLekcjeVideo').css('display', 'block');
		}

	});





	/******** ZMIENIARKA VIDEO LEKCJI ***************/
	$('.vtab_').click(function() {
		var tmp=$(this).attr('id').split('_');
		tmp=tmp[1];
		$('.vtab_ a').removeClass('active');
		$(this).children().addClass('active');
		$('.vbox').css('display', 'none');
		$('#vbox_'+tmp).css('display', 'block');
	});


	$('.vtab').click(function() {
		$('.vbox').css('display', 'none');
		$('.vtab a').removeClass('active');
		$(this).children().addClass('active');
		var tmp=$(this).attr('id').split('_');
		tmp=tmp[1];
		$('#vbox_'+tmp).css('display', 'block');
		cur_p1=tmp;
		tmp=$('#vbox_'+tmp).children().attr('id').split('_');
		tmp=tmp[1];
		$('.vsub a').removeClass('active');
		$('#vsub_'+tmp).children().addClass('active');
		cur_p2=tmp;
		vchange(cur_p1,cur_p2);
		
		
	});

	$('.vsub').click(function() {
		var tmp=$(this).attr('id').split('_');
		tmp=tmp[1];
		cur_p2=tmp;
		$('.vsub a').removeClass('active');
		$(this).children().addClass('active');
		vchange(cur_p1,cur_p2);
	});




});

function vchange(p1,p2)
{
	$('#loadingOudput').show();
	$.get('/page.php?cat=104',{p1:p1,p2:p2},function(data){
		$('#loadingOudput').hide();
		$('#oudput').html(data);
	});	

}
