function description(title,post_date,description) {
//	document.write("<div style='display:block; width:100px; background:red;'>"+title+"</div><div style='display:block; width:100px;background:yellow;;'>"+post_date+"</div><div style='display:block; width:100px;background:blue;'>"+description+"</div>");
	
$('test').html("<div style='display:block; width:100px; background:red;'>"+title+"</div><div style='display:block; width:100px;background:yellow;;'>"+post_date+"</div><div style='display:block; width:100px;background:blue;'>"+description+"</div>");
}

function videoClicked(url,title,post_date,description,category, vid) {



	var flashvars = {
		xmlpath: 	 "/hottopic/flash/configuration.xml",
		prev_image:  "/media/hottopic/images/headers/main-logo_v1_m56577569830699536.gif",
		video_link:  url, 
		video_title: title,
		description: description
		//subtitle:    "subtitles/sample.sub"
	};
	var params = {
		allowFullScreen  : "true",
		allowScriptAccess: "always",
		wmode: "transparent",
		movie: "/hottopic/flash/videoPlayerV2.swf" 
	};
	var attributes = {
		id  : "vplayer", 
		name: "vplayer"
	};
	swfobject.embedSWF("/hottopic/flash/videoPlayerV2.swf", "vplayer", "426", "341", "9.0.115", "/hottopic/flash/expressInstall.swf", flashvars, params, attributes);
	swfmacmousewheel.registerObject(attributes.id);

var facebook_url;
facebook_url =   "http://" + window.location.hostname + "/sh_share/videos/detail/" + vid;

var myNewTitle = title.replace(/\'/, " ");

var sharelink = "<div style='float: left;' id='share'><a href=\'javascript:socialpop(\"facebook\", \""+myNewTitle+"\", \""+myNewTitle+"\", \""+facebook_url+"\")\'><img border=\'0\' title=\'Facebook\' name=\'Facebook\' src=\'http://community.hottopic.com/hottopic/images/productPage/face.gif\'/></a>&nbsp;<a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"digg\", \""+myNewTitle+"\", \""+myNewTitle+"\", \""+facebook_url+"\")\'><img border=\'0\' title=\'Digg\' name=\'Digg\' src=\'http://community.hottopic.com/hottopic/images/productPage/social.gif\'/></a>&nbsp;<a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"delicious\", \""+myNewTitle+"\", \""+myNewTitle+"\", \""+facebook_url+"\")\'><img border=\'0\' title=\'delicious\' name=\'delicious\' src=\'http://community.hottopic.com/hottopic/images/productPage/social2.gif\'/></a>&nbsp;<a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"twiter\", \""+myNewTitle+"\", \""+myNewTitle+"\", \""+facebook_url+"\")\'><img border=\'0\' title=\'twiter\' name=\'twiter\' src=\'http://community.hottopic.com/hottopic/images/productPage/social3.gif\'/></a>&nbsp;<a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"myspace\", \""+myNewTitle+"\", \""+myNewTitle+"\", \""+facebook_url+"\")\'><img border=\'0\' title=\'myspace\' name=\'myspace\' src=\'http://community.hottopic.com/hottopic/images/productPage/myspace.gif\'/></a>&nbsp;&nbsp;<a style=\'margin-left: -3px;\' href=\'#\'><img onclick=\'return openpopup_email(\"video\", \""+vid+"\")\' border=\'0\' title=\'Email a friend\' name=\'emailfriend\' src=\'/sites/all/modules/sh_share/images/email_friend.jpg\'/></div>";

document.getElementById('descriptiondiv').innerHTML  =    '<div class="Title_text2"><b>' + title + ' - ' + post_date + '</b></div><div class="category"><b>Category : </b>' + category + '<br \><table border="0"><tr><td valign="top"></td></tr></table></div><div class="video_description">' + description + '</div><div><br><b style="float:left;">Share this content: </b>' + sharelink + '</div>';

}

//var sharelink = "<div style='float: left;' id='share'><a href=\'javascript:socialpop('facebook', 'Social Collision Grey Distill Wash Rude Fit Jeans')\'><img border=\'0\' title=\'Facebook\' name=\'Facebook\' src=\'http://community.hottopic.com/hottopic/images/productPage/face.gif\'/></a><a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"digg\", \"Social Collision Grey Distill Wash Rude Fit Jeans\")\'><img border=\'0\' title=\'Digg\' name=\'Digg\' src=\'http://community.hottopic.com/hottopic/images/productPage/social.gif\'/></a><a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"delicious\", \"Social Collision Grey Distill Wash Rude Fit Jeans\")\'><img border=\'0\' title=\'delicious\' name=\'delicious\' src=\'http://community.hottopic.com/hottopic/images/productPage/social2.gif\'/></a><a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"twiter\", \"Social Collision Grey Distill Wash Rude Fit Jeans\")\'><img border=\'0\' title=\'twiter\' name=\'twiter\' src=\'http://community.hottopic.com/hottopic/images/productPage/social3.gif\'/></a><a style=\'margin-left: -3px;\' href=\'javascript:socialpop(\"myspace\", \"Social Collision Grey Distill Wash Rude Fit Jeans\")\'><img border=\'0\' title=\'myspace\' name=\'myspace\' src=\'http://community.hottopic.com/hottopic/images/productPage/myspace.gif\'/></a><a href=\'JavaScript:OpenViewWindow(\"http://www.hottopic.com/hottopic/services/emailFriend.jsp\",504,700,\"yes\",\"no\")\'><img border=\'0\' style=\'padding-left: 10px;\' src=\'http://community.hottopic.com/hottopic/images/productPage/email-to-friend.gif\'/></a></div>";

function socialpop(socialsite, blog_title, description, url){

    var location = url;
    var title = "Hottopic.com - " + blog_title;
    var winwidth = '626';
    var winheight = '436';

    if (socialsite == "facebook"){
        window.open('http://www.facebook.com/sharer.php?src=bm&v=4&i=1233878112&u='+location+'&t='+title, 'facebook','toolbar=0,status=0,width='+winwidth+',height='+winheight+',top=100,left=100');

    }
    else if (socialsite == "myspace"){

        window.open('http://www.myspace.com/index.cfm?fuseaction=postto&d=testing&t='+title+'&c='+description+'&u='+location+'&l=Blog', 'myspace','toolbar=0,status=0,width='+winwidth+',height='+winheight+',top=100,left=100');

    }
    else if(socialsite == "twiter"){

        var myOldString = blog_title;
        var myNewString = myOldString.replace(" ", "+");
        myNewString = myNewString + " at "+ location;
        window.open("http://twitter.com/home?status=" + myNewString, 'twitter','toolbar=0,status=0,width='+winwidth+',height='+winheight+',top=100,left=100');
        //window.open("http://twitthis.com/twit?url="+location+"&title="+title);

    }
    else if(socialsite == "digg"){
        window.open('http://digg.com/submit?url='+location+'&title='+title+'&bodytext='+description);
    }
    else if(socialsite == "delicious"){
        window.open('http://delicious.com/save?v=5&noui&jump=close&url='+location+'&amp;title='+title+'&notes='+description, 'delicious','toolbar=0,status=0,width='+winwidth+',height='+winheight+',top=100,left=100');
    }


}

