function ajaxFunction(UpdateDivId,Url,parentDivId,PUrl) {
var xmlHttp = null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
  
  
  
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
                if(xmlHttp.readyState==4)
                  {
                        document.getElementById(UpdateDivId).innerHTML=xmlHttp.responseText;
                        if (parentDivId !=""){
                            //alert(parentDivId + "    "+PUrl);
                            ajaxFunction(parentDivId,PUrl,'','');
                        }
                  }else {
                    document.getElementById(UpdateDivId).innerHTML = "<img src=\"images/loader1.gif\" align=\"center\" style=\"margin:2px;\">";
                  }
    }
    //var par="CatID=" + CatID + document.getElementById("param").value + con;
    
    var rand_no = Math.random();

    xmlHttp.open("GET",Url+"&r="+rand_no,true);
    xmlHttp.send(null);
     
}

          
          
function showHide(objID,objV){
    if (objV == "1") document.getElementById(objID).style.display = "block";
    else document.getElementById(objID).style.display = "none";
}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}

function getWindowHeight() {
    var browser=navigator.appName;
    //var b_version=navigator.appVersion;
    //var version=parseFloat(b_version);
    //window.innerHeight;
  var myHeight = 0;
  if( browser == 'Netscape' ) {
    myHeight = document.body.clientHeight;
  } else if( browser == 'Opera') {
    myHeight = document.documentElement.clientHeight;
  } else {
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY;
  //alert(scrOfY+"---"+scrOfX);
  //return [ scrOfX, scrOfY ];
}




function ShowDiv(objId,Url,param1){
    var scr_pos = getScrollXY();
    //alert(getWindowHeight());
    showHide(objId,param1);
    showHide(objId+"c",param1);
    if(param1=="1") {
		document.getElementById(objId).style.height = getWindowHeight() + "px";
		document.getElementById(objId).style.width = document.body.clientWidth + "px";
		document.getElementById(objId+"c").style.top = ( scr_pos + 40 ) + "px";
		ajaxFunction(objId+"c",Url,'','');
		//alert(Url);
	}
}

function GetCommentValue(objId,Url){
    //alert(document.getElementById("txt").value);
    //document.getElementById("startDiv").style.display = "none";
    var itemid = document.getElementById("txtId").value;
    var catid = document.getElementById("txtcatId").value;
    var comm = document.getElementById("txtComment").value;
    if (comm != ""){
        ajaxFunction(objId,Url+"&itemid="+itemid+"&catid="+catid+"&comment="+comm,'','');
        //alert(Url+"&itemid="+itemid+"&catid="+catid+"&comment="+comm);
    }else{
        alert("Please write the comments!");
    }
    //alert(comm);
    //ajaxFunction(objId,Url+"&itemid="+itemid+"&comment="+comm);
}



function GetProfileValues(objId,Url,parentobjId){
    var uid = document.getElementById("ctl00_cntMain_txtUserId").value;
    //alert(document.getElementById("txt_file").value);
    var pagevalue= new Array();
	pagevalue[0] = document.getElementById("txt_fname").value;
	pagevalue[1] = document.getElementById("txt_lname").value;
	pagevalue[2] = document.getElementById("sel_mm").value + "/" + document.getElementById("sel_dd").value + "/" + document.getElementById("sel_yy").value;
	pagevalue[3] = document.getElementById("sel_gender").value;
	pagevalue[4] = document.getElementById("txt_country").value;
	pagevalue[5] = document.getElementById("txt_email").value;
	pagevalue[6] = document.getElementById("txt_pass").value;
	//pagevalue[7] = document.getElementById("txt_file").value;
	
	ajaxFunction(objId,Url+"&uid="+uid+"&pagevalue="+pagevalue,parentobjId,"myaccount/Profile.aspx?uid="+uid);
}


///////////////////////////////////////////////////////////////////
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = {};
	
	if (qs == null) qs = location.search.substring(1, location.search.length);
	if (qs.length == 0) return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i = 0; i < args.length; i++) {
		var pair = args[i].split('=');
		var name = decodeURIComponent(pair[0]);
		
		var value = (pair.length==2)
			? decodeURIComponent(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

Querystring.prototype.get = function(key, default_) {
	var value = this.params[key];
	return (value != null) ? value : default_;
}

Querystring.prototype.contains = function(key) {
	var value = this.params[key];
	return (value != null);
}
//////////////////////////////////////////////


function abc(val){
    alert(val)
}

