﻿$(document).ready(function() {

    $('#qq').click(function() {
        $.blockUI({
            message: $('#search_box'),
            css: {
                width: '500px',
                top: '25%',
                left: '30%',
                cursor: 'pointer'
            }

        });
    });

    $("#SiteEmialList").validator({ position: 'bottom left' }); //email validator
	$("#buildOwn").change(goToBuild); // dropdown build your own
	$("#tripTake").change(goToBrowse); // dropdown build your own
	
	$(function() {
			$("#showcase_left").showcase({
                css: { width: "450px", height: "240px" },
				animation: { interval: 4500, stopOnHover: true, easefunction: "swing", speed: 600 },
				images: [
					{ url:"/images/MainPicsPacific.jpg", link:"http://asia.tripmasters.com"},
					{ url:"/images/MainPicAfrica.jpg", link:"http://africa.tripmasters.com"}, 
					{ url:"/images/MainPicEurope.jpg", link:"http://europe.tripmasters.com"}, 
                    { url:"/images/MainPicLatin.jpg", link:"http://latin.tripmasters.com"},
					{ url:"/images/MainPicBeach.jpg", link:"http://beach.tripmasters.com"},
					{ url:"/images/MainPicAsia.jpg", link:"http://asia.tripmasters.com"}
                         ],
				navigator: { position: "bottom-left",
                             css: { padding:"0px", margin: "0px 0px 1px 1px" },
                             showNumber: true,
                             item: { 
                                 css: { height:"22px", "line-height":"22px", width:"22px", "-moz-border-radius": "0px", "-webkit-border-radius": "0px", backgroundColor: "#fff", borderColor:"#CCCCCC", margin: "2px", "text-align": "center", "vertical-align": "middle", color:"#CCCCCC", "font-size":"14px"},
                                 cssHover: { backgroundColor: "#fff", borderColor: "#666666", color:"#666666" },
                                 cssSelected: { backgroundColor: "#fff", borderColor: "#666666", color:"#666666" }
                             }
                },
                titleBar: { enabled: false }
			});
 		});
	
});

function moreShow(thsDiv){
	$('#hdd'+thsDiv+'').hide();
	$('#shw'+thsDiv+'').show();
		
}
function moreHide(thsDiv){
	$('#hdd'+thsDiv+'').show();
	$('#shw'+thsDiv+'').hide();
}
function goToBuild(){
	var selVal
	selVal = $('#buildOwn option:selected');
	window.location = selVal.val()
}
function goToBrowse(){
	var brwVal
	brwVal = $('#tripTake option:selected');
	window.location = brwVal.val()
}
function openInfo(proID){
	var pic = $('#pic'+ proID +'').attr('src');
	var picidx = pic.indexOf('Plus');
	if (picidx > 0) {
		$('#pic'+ proID +'').attr('src','/images/Minus.jpg');
		$('#prod'+ proID +'').show();
	}
	else{
		$('#pic'+ proID +'').attr('src','/images/Plus.jpg');
		$('#prod'+ proID +'').hide();
	}
}
/* TO TAKE PACKAGES RELATED INFO */
var win = true;	
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}

