$(".top-header a").click(function(o) {
	var name = $(this).attr("rel");
	if(name != null && name != ""){
		var url = "/control/";
		if(name=="showcart" || name=="wishlist" || name=="showcheckout" || name=="customerProfile" || name=="logout"){
			url += name;
			window.location.href = url;
		}else if(name=="login" || name=="loginCheckout"){
			$('.login-pop').show();
		}else if (name=="contactUs"){
			getContactUs();
		}
	}
});
$(".gc a").click(function(o) {
	var ctx = {};	
    var url ="/control/getGiftCard";
    var bindArgs = {
    	type:'post',
        url: url,            
        dataType: "html",
        data: ctx,
        async:false,
        error: function(request, textStatus, errorThrown) { 
       	 	alert(evt.ctx);
        },
        beforeSend:function (XMLHttpRequest) {
	        AjaxDivStatusMsg.showAjaxDiv();    
        },
        complete:function (XMLHttpRequest, textStatus) {
       		AjaxDivStatusMsg.removeAjaxDiv();
        },	        
        success: function(data, evt) {  
        	$('.GiftCard').show();
        	$('.GiftCard').html(data);
        	writeJsCode("giftCardJs",data);
        	
        }
    };
    $.ajax(bindArgs);	
});

function getContactUs(){
	var ctx = {};	
    var url ="/control/getContactUs";
    var bindArgs = {
    	type:'post',
        url: url,            
        dataType: "html",
        data: ctx,
        async:false,
        error: function(request, textStatus, errorThrown) { 
       	 	alert(evt.ctx);
        },
        beforeSend:function (XMLHttpRequest) {
	        AjaxDivStatusMsg.showAjaxDiv();    
        },
        complete:function (XMLHttpRequest, textStatus) {
       		AjaxDivStatusMsg.removeAjaxDiv();
        },	        
        success: function(data, evt) {  
        	$('.ContactUs').show();
        	$('.ContactUs').html(data);
        	/* use jquery html, need not use the following js code
        	writeJsCode("ContactUsJs",data);
        	*/

        }
    };
    $.ajax(bindArgs);	
}	


