// JavaScript Document
$(document).ready(function(){
	$('#pop_back').hide();
	$('#popup').hide();
	$('#pop_back6').hide();
	$('#popup6').hide();
	var height=$(document).height();
	var width=$(document).width();
	function popup(wid, hei, type){
		if (type==1){
			var L=((width/2)-(wid/2));
			var T=((height/2)-(hei/2));
		}else if (type==2){
			var T=100;
			var L=((width/2)-(wid/2));
		}
		$('#pop_back').css({
			'width':width,
			'height':height,
			'position':'absolute',
			'top':'0px',
			'left':'0px',
			'background-color':'#000',
			'opacity':'0.2',
			'display':'none'
		})
		$('#popup').css({
			'width':wid,
			'height':hei,
			'position':'absolute',
			'top':T,
			'left':L,
			'background':'url(/images/popup_rep_bg.gif) bottom repeat-x #FFF',
			'display':'none',
			'padding':'15px',
			'padding-right':'0px',
			'border':'2px solid #D0D0D0',
			'-moz-border-radius':'4px',
			'-webkit-border-radius':'4px'
		})	
		$('#pop_back').fadeIn();
		$('#popup').fadeIn();
	}
	function pop_close(){
		$('#pop_back').fadeOut();
		$('#popup').fadeOut();
	}
	
//	test

function popup6(wid, hei, type){
		if (type==1){
			var L=((width/2)-(wid/2));
			var T=((height/2)-(hei/2));
		}else if (type==2){
			var T=100;
			var L=((width/2)-(wid/2));
		}
		else if (type==3){
			var L=((width/2)-(wid/2));
			var T=((height/2)-(hei/2));
		}
	
			
		$('#pop_back6').css({
			'width':width,
			'height':height,
			'position':'absolute',
			'top':'0px',
			'left':'0px',
			'background-color':'#000',
			'opacity':'0.2',
			'display':'none'
		})
		$('#popup6').css({
			'width':wid,
			'height':hei,
			'position':'absolute',
			'top':T,
			'left':L,
		
			'display':'none',
			'padding':'15px',
			'padding-right':'0px',
			'border':'0px solid #D0D0D0',
			'-moz-border-radius':'4px',
			'-webkit-border-radius':'4px'
		})	
		$('#pop_back6').fadeIn();
		$('#popup6').fadeIn();
	}
	function pop_close6(){
		$('#pop_back6').fadeOut();
		$('#popup6').fadeOut();
	}
	
	$('#pop_back6').click(function(){
	pop_close();				 
	})
	
		$('#close_btn6').click(function(){
		pop_close6();				 
	})
//	test
	$('#pop_back').click(function(){
		pop_close();				 
	})
	
	$('#btn1').click(function(){
		popup(400, 200, 1);						 
	})
	$('#btn2').click(function(){
		popup(400, 200, 1);						 
	})
	$('#btn3').click(function(){
		popup(400, 200, 2);						 
	})
	$('#btn6').click(function(){
		popup6(1000, 800, 3);						 
	})
	$('#closer').click(function(){
		pop_close();				 
	})
	$('#close_btn').click(function(){
		pop_close();				 
	})
})