function getParam(paramName){
	var paramsResult = []
	var paramsRaw = (document.location.href.split("?", 2)[1] || "").split("#")[0].split("&") || [];
	for(var i = 0; i< paramsRaw.length; i++){
		var single = paramsRaw[i].split("=");
		if(single[0])
			paramsResult[single[0]] = unescape(single[1].replace(/\+/g, " "));
	}
	return paramsResult[paramName] || "";
}

/*var contact = jQuery.url.param("ContactMediaId"); // returns 2*/
var contact = getParam("ContactMediaId"); // returns 2

$(document).ready(function() {  
	if (contact != null) {
		//alert(contact);
		  $("a").click(function() {  
					if(contact != '' && this.href!='../arc/' && this.rel!='llamanos' ) {
                        
						  if (this.href. indexOf('?') == -1)
                                          this.href=this.href+'?ContactMediaId='+contact;
                                      else
										  this.href=this.href+'&ContactMediaId='+contact;
					}
			});  
		    $("area").click(function() {  
					if(contact != '' && this.href!='../arc/' ) {
                        if(contact != '' && this.href!='../clientes/' ) {
                            if (this.href. indexOf('?') == -1)
                                   this.href=this.href+'?ContactMediaId='+contact;
                                      else
                                   this.href=this.href+'&ContactMediaId='+contact;
					}}
			}); 
			$("#ContactMediaId").attr("value",contact); 
			$("#ContactMediaIdb").attr("value",contact); 
		}
		if ($("a[rel^='prettyPhoto']")) {
			$("a[rel^='prettyPhoto']").prettyPhoto('');
		} 
		if ($("area [rel^='prettyPhoto']")) {
			$("area [rel^='prettyPhoto']").prettyPhoto('');
		} 
});  
	$(function() {
		$('a[class="tblank"]').click( function() {
			window.open( $(this).attr('href') );
			return false;
		});
		$('area[class="tblank"]').click( function() {
			window.open( $(this).attr('href') );
			return false;
		});
	});



