var ActivePortType ='';
var PreLoadPageHTML = new Array();
var AjaxPagingStartCount = new Array();
var PreLoadElementContainer = new Array();
document.domain = "musicjointz.com";
function send(id){
Shadowbox.open({
content: 'http://www.musicjointz.com/UJIM/send.asp?rid='+id,
player: 'iframe',
title: 'Instant Message',
height: 500,
width: 500
});
}
function OpenContestPage(width,height){
Shadowbox.open({
content: 'http://www.musicjointz.com/Constest/Contest.asp',
player: 'iframe',
title: 'Instant Message',
height: height,
width: width,
modal: false
});
}
function CloseWin(){
window.open('http://www.musicjointz.com/UJIM/close.asp')
}
function resizeFrame(FrameName) {
var the_height = document.getElementById(FrameName).contentWindow.document.body.scrollHeight;
document.getElementById(FrameName).height = the_height;
}
function createRequestObject()
{
var xmlHttp;
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;
}
}
}
return xmlHttp;
}
var http = createRequestObject(); ;
var response;
// this function should be called for user input
// it opens up a php page with a querystring of 'action'
// this function could probably be adapted to POST
function sndReq(action)
{
http.open("get", "ajax.php?action=" + action);
http.onreadystatechange = handleResponse;
http.send(null);
}
// the response in this case is formatted as follows:
// object|text
// where object is the id of the HTML element we are going to update
// and text is what it will be updated to
// this could obviously work a lot better with some XML
// this function should be called for user input
// it opens up the usercheck.asp page with a querystring of 'action'
function loadFragmentInToElement(fragment_url, element_id) {
try
{
var element = document.getElementById(element_id);
var httpe = createRequestObject(); ;
httpe.open("GET", fragment_url);
httpe.onreadystatechange = function() {
if (httpe.readyState == 4 && httpe.status == 200) {
element.innerHTML = httpe.responseText;
}
}
httpe.send(null);
} catch (err) {}
}
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function CheckInstantMessages(){
try
{
var httpe = createRequestObject(); ;
httpe.open("GET", 'http://www.musicjointz.com/UJIM/msgchk.asp');
httpe.onreadystatechange = function() {
if (httpe.readyState == 4 && httpe.status == 200) {
if (trim(httpe.responseText) == 'Show'){
send('')
};
}
}
httpe.send(null);
} catch (err) {}
}
function CycleRepeatFunctions(SetTime){
try
{
$("#UserSessionInfo").load('http://www.musicjointz.com/AjaxContent/AjaxUserSessionInfo.asp');
$("#WhoIsOn").load('http://www.musicjointz.com/AjaxContent/AjaxWhoisOn.asp');
CheckInstantMessages()
} catch (err) {}
setTimeout( function() { CycleRepeatFunctions(SetTime) } ,SetTime);
}
function ShowCyclingInfo(URL,element)
{
loadFragmentInToElement(URL.toString(), element.toString())
setTimeout( function() { ShowCyclingInfo(URL,element) },10000);
}
function GetRanNum(RandNum){
var rand_no = Math.random();
rand_no = rand_no * RandNum;
rand_no = Math.ceil(rand_no);
return rand_no;
}
function GetRandUrl()
{
var RandCount = GetRanNum(10);
var URL;
switch (RandCount)
{
case 1:
URL = "http://www.photojointz.com"
break;
case 2:
URL = "http://www.videojointz.com"
break;
case 3:
URL = "http://www.clubjointz.com"
break;
case 4:
URL = "http://www.musicjointz.com"
break;
case 5:
URL = "http://www.filmjointz.com"
break;
case 6:
URL = "http://www.partyjointz.com"
break;
case 7:
URL = "http://www.teenjoint.com"
break;
case 8:
URL = "http://www.talentjoint.com"
break;
case 9:
URL = "http://www.blackpartycentral.com"
break;
case 10:
URL = "http://www.teenjoint.com"
break;
}
return URL;
}
function HandleResponseRefreshAdSpot(wDiv)
{
if(http.readyState == 4) {
if (http.status == 200) {
var Refreshresponse = http.responseText;
document.getElementById(wDiv).innerHTML = Refreshresponse;
}
}
}
function RefreshAdSpot(wDiv)
{
http.open("get", "http://www.musicjointz.com/AjaxContent/AjaxTopnav_frame_ad.asp");
alert(GetRandUrl()+"/AjaxContent/AjaxTopnav_frame_ad.asp");
http.onreadystatechange = HandleResponseRefreshAdSpot(wDiv);
http.send(null);
setTimeout(function() { RefreshAdSpot(wDiv); } ,30000);
}
//////////////////////////////////////////////////////////////
var UJRadioWin;
function OpenThisWin(Width,Height,Url,WinName,loc){
var xMax = screen.width, yMax = screen.height;
switch(loc){
case 'lt':
xOffset = 0, yOffset = 0;
break;
case 'ct':
xOffset = (xMax - Width)/2, yOffset = (yMax - Height)/2;
break;
case 'rt':
xOffset = (xMax - Width), yOffset = 0;
break;
}
UJRadioWin = window.open(Url,WinName,'resizable=no,menubar=no,scrollbars=no,toolbar=no,status=no.location=no,height='+Height+',width='+Width+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
if(UJRadioWin==null){
alert("Error: While Launching New Window...nYour browser maybe blocking up Popup windows. nn Please check your Popup Blocker Settings");
}
}
////////////
function handleResponseTrackViewers()
{
if(http.readyState == 4) {
if (http.status == 200) {
response = http.responseText;
//document.getElementById('AjaxDisplayTn').innerHTML = response;
}
}
}
function TrackViewers(viewerid,profileid,action)
{
if (profileid!='' && viewerid!='' ) {
http.open("get", "http://www.musicjointz.com/AjaxContent/AjaxTrackViewers.asp?action="+action+"&viewerid="+viewerid+"&profileid="+profileid);
http.onreadystatechange = handleResponseTrackViewers;
http.send(null);
//alert(viewerid+' '+profileid+' '+action);
}
}
function TrackPortfolioCount(ChoosePic)
{
if (ChoosePic != '') {
http.open("get", "http://www.musicjointz.com/AjaxContent/AjaxPortfolioCount.asp?ChoosePic="+ChoosePic);
http.onreadystatechange = handleResponseTrackViewers;
http.send(null);
//alert(ChoosePic);
}
}
function UpdateWMPSession(value)
{
http.open("get", "http://www.musicjointz.com/AjaxContent/AjaxSession.asp?Action=set&SessionName=WMPSession&SessionValue="+value);
http.onreadystatechange = function() {};
http.send(null);
//alert(value);
}
var SessionASPVar;
function SetGetSession(session,value,action)
{
http.open("get", "http://www.musicjointz.com/AjaxContent/AjaxSession.asp?Action="+action+"&SessionName="+session+"&SessionValue="+value);
http.send(null);
http.onreadystatechange = function() {
if(http.readyState == 4) {
if (http.status == 200) {
SessionASPVar = http.responseText;
//alert(SessionASPVar)
}
}
};
}
var isIE = (navigator.appVersion.toLowerCase().indexOf('msie 6.0') != -1);
function ShowArtistLayerOverHover(element){
if (isIE) {
element.getElementsByTagName('a')[0].getElementsByTagName('span')[0].style.display = "inline";
}
else {
element.getElementsByTagName('a')[0].getElementsByTagName('img')[0].style.display = "inline";
}
}
function ShowArtistLayerOutHover(element){
if (isIE) {
element.getElementsByTagName('a')[0].getElementsByTagName('span')[0].style.display = "none";
}
else {
element.getElementsByTagName('a')[0].getElementsByTagName('img')[0].style.display = "none";
}
}
function readCookie(name)
{
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}
function writeCookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
var cookie_string = name + "=" + escape ( value );
if ( exp_y )
{
var expires = new Date ( exp_y, exp_m, exp_d );
cookie_string += "; expires=" + expires.toGMTString();
}
if ( path )
cookie_string += "; path=" + escape ( path );
if ( domain )
cookie_string += "; domain=" + escape ( domain );
if ( secure )
cookie_string += "; secure";
document.cookie = cookie_string;
}
function showhidelogin(){
if ( readCookie('svAccess') != ''){
document.getElementById("shohidelogin").style.display = 'none';
} else {
document.getElementById("shohidelogin").style.display = 'block';
}
}
function PostForm(where){
switch(where)
{
case 1:
document.SearchForm.action='http://www.musicjointz.com/SearchPortResult.asp'
break;
case 2:
document.SearchForm.action='http://www.musicjointz.com/UJforum/searchResult.asp'
break;
default:
document.SearchForm.action='http://www.musicjointz.com/ArtistCommunity.asp'
}
}
function OnDivScroll(AjaxUrl,element_id,height,SetPortType)
{
StoreSessionInfo (SetPortType);
var el = document.getElementById(element_id);
PreLoadPagingScrollHight = el.scrollHeight;
if(el.scrollTop < el.scrollHeight - (height*2)){
return;
}
ActivePortType = SetPortType;
var loading = document.getElementById(element_id + 'loadingDiv');
if(loading.style.display == '') {
return; //already loading
}
loading.style.display = '';
LoadMoreElements(AjaxUrl,element_id,SetPortType);
}
function loadPagingInToElement(fragment_url, element_id,SetPortType) {
//alert(fragment_url)
try
{
var element = document.getElementById(element_id);
var httpe = createRequestObject(); ;
httpe.open("GET", fragment_url);
httpe.onreadystatechange = function() {
if (httpe.readyState == 4 && httpe.status == 200) {
element.innerHTML += httpe.responseText ;
PreLoadPageHTML[SetPortType] += httpe.responseText ;
var x = element.getElementsByTagName("script");
for(var i=0;i 1){
MainBodHeight = Math.floor(MainBodHeight / thissplit)
}
if ( readCookie('svAccess') == ''){
MainBodHeight = MainBodHeight - 25;
}
thisHeight = MainBodHeight +'px';
document.getElementById(ediv).mouseWheelEnabled = false;
document.getElementById(escroll).mouseWheelEnabled = false;
setTimeout(function () { document.getElementById(ediv).style.height = thisHeight; document.getElementById(escroll).style.height = thisHeight;}, 1000);
// document.getElementById(ediv).style.height = thisHeight
// document.getElementById(escroll).style.height = thisHeight
}
function ClearEventCityButtons(buttonGroup){
var theButton = document.getElementsByName(buttonGroup);
for(i=0;i< theButton.length;i++) {
theButton[i].checked=false;
}
}
function MakeShadowLinksVisible(ShadowboxLinkArray){
$('.ShadowBoxHideLink').css('visibility','visible');
for (x in ShadowboxLinkArray)
{
if (document.getElementById(ShadowboxLinkArray[x])!= null) {
document.getElementById(ShadowboxLinkArray[x]).style.visibility = "visible";
}
}
}
var __isIE = navigator.appVersion.match(/MSIE/);
var __userAgent = navigator.userAgent;
var __isFireFox = __userAgent.match(/firefox/i);
var __isFireFoxOld = __isFireFox && (__userAgent.match(/firefox\/2./i) || __userAgent.match(/firefox\/1./i));
var __isFireFoxNew = __isFireFox && !__isFireFoxOld;
function __parseBorderWidth(width) {
var res = 0;
if (typeof(width) == "string" && width != null && width != "" ) {
var p = width.indexOf("px");
if (p >= 0) {
res = parseInt(width.substring(0, p));
}
else {
//do not know how to calculate other values (such as 0.5em or 0.1cm) correctly now
//so just set the width to 1 pixel
res = 1;
}
}
return res;
}
//returns border width for some element
function __getBorderWidth(element) {
var res = new Object();
res.left = 0; res.top = 0; res.right = 0; res.bottom = 0;
if (window.getComputedStyle) {
//for Firefox
var elStyle = window.getComputedStyle(element, null);
res.left = parseInt(elStyle.borderLeftWidth.slice(0, -2));
res.top = parseInt(elStyle.borderTopWidth.slice(0, -2));
res.right = parseInt(elStyle.borderRightWidth.slice(0, -2));
res.bottom = parseInt(elStyle.borderBottomWidth.slice(0, -2));
}
else {
//for other browsers
res.left = __parseBorderWidth(element.style.borderLeftWidth);
res.top = __parseBorderWidth(element.style.borderTopWidth);
res.right = __parseBorderWidth(element.style.borderRightWidth);
res.bottom = __parseBorderWidth(element.style.borderBottomWidth);
}
return res;
}
//returns absolute position of some element within document
function getAbsolutePos(element) {
var res = new Object();
res.x = 0; res.y = 0;
if (element !== null) {
res.x = element.offsetLeft;
res.y = element.offsetTop;
var offsetParent = element.offsetParent;
var parentNode = element.parentNode;
var borderWidth = null;
while (offsetParent != null) {
res.x += offsetParent.offsetLeft;
res.y += offsetParent.offsetTop;
var parentTagName = offsetParent.tagName.toLowerCase();
if ((__isIE && parentTagName != "table") || (__isFireFoxNew && parentTagName == "td")) {
borderWidth = __getBorderWidth(offsetParent);
res.x += borderWidth.left;
res.y += borderWidth.top;
}
if (offsetParent != document.body && offsetParent != document.documentElement) {
res.x -= offsetParent.scrollLeft;
res.y -= offsetParent.scrollTop;
}
//next lines are necessary to support FireFox problem with offsetParent
if (!__isIE) {
while (offsetParent != parentNode && parentNode !== null) {
res.x -= parentNode.scrollLeft;
res.y -= parentNode.scrollTop;
if (__isFireFoxOld) {
borderWidth = _getBorderWidth(parentNode);
res.x += borderWidth.left;
res.y += borderWidth.top;
}
parentNode = parentNode.parentNode;
}
}
parentNode = offsetParent.parentNode;
offsetParent = offsetParent.offsetParent;
}
}
return res;
}
function getPosition(element){
var obj = document.getElementById(element);
var pos = getAbsolutePos(obj);
return [pos.x - (256/2) +(256/2) , pos.y + 60];
}
function HtmlAlert(text)
{
document.getElementById('aportfolio').innerHTML = text + ' ';
}
function changeheight(did){
var x = 100;
var y = 210;
var q = 5;
var f = 0;
var g = 0;
e=document.getElementById(did);
if (e != null) {
e.style.zIndex = 100;
e.style.styleFloat = "none";
if(y>290&&g==0){g=1;return;}
if(y<211&&g==1){g=0;return;}
if(g)q=-5;if(!g)q=5;y=y+q;
e.style.height = y + 'px';
t=setTimeout("changeheight();",0);
}
}
function SetScrollSession(Action,Data,ThisElement,SessionName)
{
try
{
var httpe = createRequestObject();
var url = "http://www.musicjointz.com/AjaxContent/AjaxSession.asp"
var params = "Action="+Action+"&SessionValue="+encodeURIComponent(Data)+"&SessionName="+SessionName;
httpe.open("POST", url, true);
//Send the proper header information along with the request
httpe.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
httpe.setRequestHeader("Content-length", params.length);
httpe.setRequestHeader("Connection", "close");
httpe.onreadystatechange = function() {
if (httpe.readyState == 4 && httpe.status == 200) {
if (Action == "get"){
if (httpe.responseText !="") {
var element = document.getElementById(ThisElement);
element.innerHTML += httpe.responseText;
window.scrollTo(0,readCookie(SessionName+"ScrollPos"));
}
}
}
}
httpe.send(params);
} catch (err) {}
}
function PostFileDate(userID,DefaultName,filename,filememo,ObjID,DoWhat)
{
http.open("get", "http://www.musicjointz.com/AjaxContent/AjaxAddImages.asp?userID="+userID+"&DefaultName="+DefaultName+"&filename="+filename+"&filememo="+filememo+"&ObjID="+ObjID+"&DoWhat="+DoWhat);
http.onreadystatechange = handleResponseTrackViewers;
http.send(null);
//alert(viewerid+' '+profileid+' '+action);
}
function ClearDivInnderHTML(ThisElement){
var element = document.getElementById(ThisElement);
element.innerHTML = '';
}
function RemoveBadChar(ele){
document.getElementById(ele).value = document.getElementById(ele).value.replace(/[^a-zA-Z0-9-_]/g, "");
}
function ShadowBoxOpen(url,title,width,height){
Shadowbox.open({
content: url,
player: 'iframe',
title: title,
height: height,
width: width
});
}
function reloadImage(objId,src)
{
img = document.getElementById(objId);
img.src = src;
}
function ClearFromValues(ele)
{
var str = '';
var elem = document.getElementById(ele).elements;
for(var i = 0; i < elem.length; i++)
{
elem[i].value = "";
}
}
function ResetForm(ele,hiddeneel){
document.getElementById(ele).reset();
var hiddeneelArray = hiddeneel.split("|")
for (x in hiddeneelArray){
document.getElementById(hiddeneelArray[x]).value ='';
}
$("#showimages").html("");
}
function RefreshImage(valImageId) {
var objImage = document.images[valImageId];
if (objImage == undefined) {
return;
}
var now = new Date();
objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
function valButton(btn,alerttxt) {
var radio_choice = false;
for (counter = 0; counter < btn.length; counter++) {
if (btn[counter].checked){
radio_choice = true;
}
}
if (!radio_choice) {
return 0;
} else {
return 1;
}
}
function validate_required(field,alerttxt)
{
with (field) {
if (value==null||value=="") {
return 0;
} else {
return 1;
}
}
}
JplayerNowPlaying = "";
var CurrentPlayTime = new Array()
WasPlaying = 0;
function PlaySelected(fileLocation, callingParty,percentDiv,ChoosePic)
{
if ($('#'+callingParty).hasClass("SingleSongPlay"))
{
try{
WasPlaying = JplayerNowPlaying;
JplayerNowPlaying = ChoosePic;
parent.PlaySingleSong(ChoosePic);
$(".PortTableClass").css('background-color','');
$(".PortTableClass").removeClass('ui-widget ui-widget-content_ujbox_eee ui-corner-all');
$(".jplay-button").removeClass("SingleSongStop").addClass("SingleSongPlay");
$("#jp_interface_" + JplayerNowPlaying).hide();
$('#'+callingParty).removeClass("SingleSongPlay").addClass("SingleSongStop");
$("#PortTableClass_"+ChoosePic).css('background-color','#FF6600');
$("#PortTableClass_"+ChoosePic).addClass('ui-widget ui-widget-content_ujbox_eee ui-corner-all');
} catch(err){};
}
else
{
parent.StopMusic();
$('#'+callingParty).removeClass("SingleSongStop").addClass("SingleSongPlay");
}
parent.$("#jquery_jplayer").jPlayer("onSoundComplete", function()
{
$('#'+callingParty).removeClass("SingleSongStop").addClass("SingleSongPlay");
});
}
function PlayMainRadio()
{
parent.ChangeGenre('Music')
parent.$("#VidFooter").show();
}
function StopMainPayer(){
try{
parent.StopMusic();
parent.$("#VidFooter").hide();
} catch(err){};
}
function StopSimplePlayer(){
try{
$("#jp_interface_play_but_"+JplayerNowPlaying).removeClass("SingleSongStop").addClass("SingleSongPlay");
$("#jp_interface_play_but_Single"+JplayerNowPlaying).removeClass("SingleSongStop").addClass("SingleSongPlay");
$("#jp_interface_play_but_Avatar"+JplayerNowPlaying).removeClass("SingleSongStop").addClass("SingleSongPlay");
$(".PortTableClass").css('background-color','');
$(".PortTableClass").removeClass('ui-widget ui-widget-content_ujbox_eee ui-corner-all');
} catch(err){};
}
function ShowHideElement(element,sh){
if (sh ==1) {
$("#" + element).fadeIn('slow');
} else {
$("#" + element).fadeOut('slow');
}
}
function loadContentAlt(id,MediaType,tab) {
switch(MediaType)
{
case 'Image':
ScriptNamePage = 'AjaxShowThisPhoto.asp?traktype=' + MediaType;
ScriptNameSingle = 'AjaxShowThisPhotoItem.asp?traktype=' + MediaType;
UrLRewriteLink = 'showthisphoto';
MediaKind = '';
break;
default:
ScriptNamePage = 'AjaxShowThisMedia.asp?traktype=' + MediaType;
ScriptNameSingle = 'AjaxShowThisMediaItem.asp?traktype=' + MediaType;
UrLRewriteLink = 'showthismedia';
MediaKind = MediaType;
break;
}
switch(AltContent)
{
case 0:
URL = 'http://www.musicjointz.com/AjaxContent/'+ ScriptNamePage + '&ChoosePic='+ id;
loadContent(URL,tab);
break;
case 1:
URL = 'http://www.musicjointz.com/'+ UrLRewriteLink +'/'+ id +'/'+ MediaKind +'/1';
location.href = URL;
break;
case 2:
URL = 'http://www.musicjointz.com/AjaxContent/'+ ScriptNameSingle +'&ChoosePic='+ id;
loadPortItemContent(URL,MediaType,tab);
}
//alert(URL+' AltContent='+AltContent)
}
function loadContent(id,tab) {
DoNotScroll = 1;
$('#ArtistPortItemContainerLoading').html("");
$('#ArtistPortItemContainerLoading').fadeOut("slow");
$('#ArtistPortItemContainerLoading').html('
Loading ');
$('#ArtistPortItemContainerLoading').fadeIn("slow");
$("#ArtistpageContainer").fadeOut("slow");
$("#ArtistpageContainer").hide();
$("#ArtistpageContainer").load(id, function() {
$("#ArtistpageContainer").fadeIn("slow")
setTimeout( function() { $('#ArtistPortItemContainerLoading').fadeOut("slow"); } , 1000);
});
TabbedPanels1.showPanel(tab);
}
function loadPortItemContent(id,MediaType,tab) {
$('#ArtistPortItemContainerLoading').html('
Loading ');
$('#ArtistPortItemContainerLoading').fadeIn("slow");
$("#ArtistpageContainer").fadeOut("slow");
$("#ArtistpageContainer").hide();
$("#ArtistPortItemContainer").load(id, function() {
if (MediaType=='Image') {
$("#MainImage").load(function() {
$("#ArtistpageContainer").fadeIn("slow");
setTimeout( function() {$('#ArtistPortItemContainerLoading').fadeOut("slow"); } , 1000); });
} else {
$("#ArtistpageContainer").fadeIn("slow")
setTimeout( function() {$('#ArtistPortItemContainerLoading').fadeOut("slow"); } , 1000); }
});
TabbedPanels1.showPanel(tab);
}
function DeleteYouTubeVideo(id,fileId)
{
$('#RemoveYouTubeVid_'+fileId).load('http://www.musicjointz.com/AjaxContent/AjaxRemoveYouTubeVideo.asp?YouTubeVidId=' + id)
}
function DeleteImage(FileId, FileName, UserId)
{
$('#RemoveFile_'+FileId).load('http://www.musicjointz.com/AjaxContent/AjaxRemoveImage.asp?UserId=' + UserId + '&FileId=' + FileId +'&FileName=' + FileName )
}
function DeleteSoundCloudMusic(SoundCloudId,fileId)
{
$('#RemoveMusicId_'+fileId).load('http://www.musicjointz.com/AjaxContent/AjaxRemoveSoundCloudMusic.asp?SoundCloudId='+ SoundCloudId +'&MusicId=' + fileId)
}
function SetFileRating(FileId, score)
{
$.get('http://www.musicjointz.com/AjaxContent/AjaxFileVoting.asp?FileId=' + FileId + '&voteValue='+score, function(data) {
});
}
function createFormAndSubmit(URL){
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "http://www.musicjointz.com/MainContentPage.php");
var hiddenField = document.createElement("input");
hiddenField.setAttribute("name", "OpenPage");
hiddenField.setAttribute("value", URL);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
}