jQuery.extend({
 getURLParam: function(strParamName){
	  var strReturn = "";
	  var strHref = window.location.href;
	  var bFound=false;
	  
	  var cmpstring = strParamName + "=";
	  var cmplen = cmpstring.length;

	  if ( strHref.indexOf("?") > -1 ){
	    var strQueryString = strHref.substr(strHref.indexOf("?")+1);
	    var aQueryString = strQueryString.split("&");
	    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
	      if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
	        var aParam = aQueryString[iParam].split("=");
	        strReturn = aParam[1];
	        bFound=true;
	        break;
	      }
	      
	    }
	  }
	  if (bFound==false) return null;
	  return strReturn;
	}
});
var param1 = $.getURLParam("noredirection");
$(document).ready(function() { 
	$("#mobileoff").hide();
	if(param1 == 'true') {
	  // code to be executed if condition is true
	  $("#mobileoff").show();
	  jQuery.cookie('mobile_cookie', 'mobile');
	   //alert(jQuery.cookie('mobile_cookie'));
	  return false;
	}
	else {
		// code to be executed if condition is false
		if(jQuery.cookie('mobile_cookie') == 'mobile') {
			$("#mobileoff").show();
		 }
		 else {
		 	if ((navigator.userAgent.match(/iPhone/i))) {
			   jQuery.cookie('mobile_cookie', null);
			   //alert(jQuery.cookie('mobile_cookie'));
			   location.replace("http://m.goldenhaven.com/");
			}
		 }
	}
	$('a[rel=external]').attr('target','_blank');
}); 
