<?php
function GoToURL($url)
{
	echo"<script>window.location='".$url."';</script>";
}

function jsalert($text)
{
echo"<script> alert(\"$text\"); </script>";
}
function getNumrow($SQL)
{
	$RESULT=mysql_query($SQL)or die($SQL);
	$numrow=mysql_num_rows($RESULT);
	return $numrow;
}

function Getmailvalue($val)
{
$sql="SELECT * FROM sbs_config where cof_var ='$val' LIMIT 0,1";
$result=mysql_query($sql) or die ($sql);
$crow=mysql_fetch_array($result);
return $crow["cof_value"];
}

function jsback()
{
echo"<script> javascript:history.back(); </script>";
}
$thai_day_arr=array("อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์");
$thai_month_arr=array(
	"0"=>"",
	"1"=>"มกราคม",
	"2"=>"กุมภาพันธ์",
	"3"=>"มีนาคม",
	"4"=>"เมษายน",
	"5"=>"พฤษภาคม",
	"6"=>"มิถุนายน",	
	"7"=>"กรกฎาคม",
	"8"=>"สิงหาคม",
	"9"=>"กันยายน",
	"10"=>"ตุลาคม",
	"11"=>"พฤษจิกายน",
	"12"=>"ธันวาคม"					
);
function thai_date($time){
	global $thai_day_arr,$thai_month_arr;
	$thai_date_return.=	" ".date("j",$time);
	$thai_date_return.=" ".$thai_month_arr[date("n",$time)];
	$thai_date_return.=	" ".(date("Yํ",$time)+543);
	return $thai_date_return;
}
function thai_date_mini($time){
	global $thai_day_arr,$thai_month_arr;
	//$thai_date_return.=	" ".date("j",$time);
	$thai_date_return.=" ".$thai_month_arr[date("n",$time)];
	return $thai_date_return;
}


$eng_day_arr=array("SUN","MON","TUE","WED","THU","FRI","SAT");
$eng_month_arr=array(
	"0"=>"",
	"1"=>"January",
	"2"=>"February",
	"3"=>"March",
	"4"=>"April",
	"5"=>"May",
	"6"=>"June",	
	"7"=>"July",
	"8"=>"August",
	"9"=>"September",
	"10"=>"October",
	"11"=>"November",
	"12"=>"December"					
);
function eng_date($time){
	global $eng_day_arr,$eng_month_arr;
	//$eng_date_return.=	" ".date("j",$time);
	$eng_date_return.=" ".$eng_month_arr[date("n",$time)];
	$eng_date_return.=	" ".(date("Y",$time));
	return $eng_date_return;
}
function eng_date_mini($time){
	global $eng_day_arr,$eng_month_arr;
	$eng_date_return.=	" ".date("j",$time);
	$eng_date_return.=" ".$eng_month_arr[date("n",$time)];
	return $eng_date_return;
}
function Typelist($dbname,$filde,$table,$order,$value,$name,$shownone,$selected) {
echo"<select name=\"$filde\" id=\"$filde\" style=\"width:205px\" id=\"textfield\">";
if($shownone == "1") {echo"<option value=\"\">--ไม่มี--</value>";}
if($shownone == "en") {echo"<option value=\"\">ALL</value>";}
if($shownone == "") {echo"<option value=\"\">ทั้งหมด</value>";}
if($shownone == "th") {echo"<option value=\"\">ทั้งหมด</value>";}


$strsql = "select * from ".$table." order by ".$order;
$dbquery = mysql_db_query($dbname,$strsql);
while ($result = mysql_fetch_array($dbquery)) {
	if($selected > "0") { if($result[$value] != $selected){$sld = "";}else{$sld = "selected";}}
echo "<option value=\"".$result[$value]."\" $sld>".$result[$name]."</option>";
}
echo"</select>";
}



function Typelist_ddmenu($dbname,$filde,$table,$order,$value,$name,$shownone,$selected) {
echo"<select name=\"$filde\" id=\"$filde\" style=\"width:180px\" OnChange=\"MM_jumpMenu('parent',this,0)\">";
if($shownone == "en") {echo"<option value=\"?plc=1\">--Select branch--</value>";}
if($shownone == "") {echo"<option value=\"?plc=1\">--เลือกสถานที่อบรม--</value>";}
if($shownone == "th") {echo"<option value=\"?plc=1\">--เลือกสถานที่อบรม--</value>";}

$strsql = "select * from ".$table." order by ".$order;
$dbquery = mysql_db_query($dbname,$strsql);
while ($result = mysql_fetch_array($dbquery)) {
	if($selected > "0") { if($result[$value] != $selected){$sld = "";}else{$sld = "selected";}}
echo "<option value=\"?plc=".$result[$value]."&lang=$shownone\" $sld>".$result[$name]."</option>";
}
echo"</select>";
}

//function cms($cmsid,$lang)
//{
// $lang = "th";
// $cmssql="select  * from sbs_cms_all WHERE cms_id ='$cmsid' LIMIT 0,1";
// $cmsquery =mysql_query($cmssql) or die ($cmssql);
// while($cmsrow = mysql_fetch_array($cmsquery)) {
//if($lang =="th")
	 {
//echo $cmsrow["cms_content"];
	 }
//elseif($lang =="en")
 	 {
//echo $cmsrow["cms_content_eng"];
	 }
//}
//}

function cms($cmsid, $lang = "th") {
    // สมมุติว่าเชื่อมต่อฐานข้อมูลผ่าน $this->link
    global $mysqli; // หรือใช้ $this->link ถ้าอยู่ใน class

    $cmsid = mysqli_real_escape_string($mysqli, $cmsid);  // ✅ ป้องกัน SQL injection
    $cmssql = "SELECT * FROM sbs_cms_all WHERE cms_id = '$cmsid' LIMIT 1";

    $cmsquery = mysqli_query($mysqli, $cmssql);
    if (!$cmsquery) {
        die("Query failed: " . mysqli_error($mysqli));
    }

    while ($cmsrow = mysqli_fetch_assoc($cmsquery)) {
        if ($lang == "th") {
            echo $cmsrow["cms_content"];
        } elseif ($lang == "en") {
            echo $cmsrow["cms_content_eng"];
        }
    }
}


//function descms($cmsid,$lang)
//{
// $cmssql="select  * from sbs_cms_all WHERE cms_id ='$cmsid' LIMIT 0,1";
// $cmsquery =mysql_query($cmssql) or die ($cmssql);
// while($cmsrow = mysql_fetch_array($cmsquery)) {
//if($lang =="th")
//	 {
//return $cmsrow["cms_content"];
//	 }
//elseif($lang =="en")
// 	 {
//return $cmsrow["cms_content_eng"];
//	 }
//}
//}

function descms($cmsid, $lang = "th") {
    global $link; // ใช้ connection ที่สร้างไว้ล่วงหน้า

    $cmsid_safe = mysqli_real_escape_string($link, $cmsid);
    $cmssql = "SELECT * FROM sbs_cms_all WHERE cms_id = '$cmsid_safe' LIMIT 1";

    $cmsquery = mysqli_query($link, $cmssql);

    if (!$cmsquery) {
        die("SQL Error: " . mysqli_error($link));
    }

    if ($cmsrow = mysqli_fetch_assoc($cmsquery)) {
        if ($lang == "th") {
            return $cmsrow["cms_content"];
        } elseif ($lang == "en") {
            return $cmsrow["cms_content_eng"];
        }
    }

    return ""; // หากไม่พบข้อมูล
}

//function cmstitle($cmsid,$lang)
//{
// $cmssql="select  * from sbs_cms_all WHERE cms_id ='$cmsid' LIMIT 0,1";
// $cmsquery =mysql_query($cmssql) or die ($cmssql);
// while($cmsrow = mysql_fetch_array($cmsquery)) {
//if($lang =="th")
//	 {
//echo $cmsrow["cms_title"];
//	 }
//elseif($lang =="en")
// 	 {
//echo $cmsrow["cms_title_eng"];
//	 }
//}
//}
		 
function cmstitle($cmsid, $lang = "th") {
    // เปิด connection แยกเฉพาะฟังก์ชันนี้
    $link = mysqli_connect("localhost", "username", "password", "your_database");

    if (!$link) {
        die("Connection failed: " . mysqli_connect_error());
    }

    // ป้องกัน SQL Injection
    $cmsid_safe = mysqli_real_escape_string($link, $cmsid);
    $sql = "SELECT cms_title, cms_title_eng FROM sbs_cms_all WHERE cms_id = '$cmsid_safe' LIMIT 1";
    $result = mysqli_query($link, $sql);

    if ($result && $row = mysqli_fetch_assoc($result)) {
        echo ($lang === "en") ? $row['cms_title_eng'] : $row['cms_title'];
    }

    mysqli_close($link); // ปิด connection เฉพาะฟังก์ชัน
}		 

function cmsimg($cmsid,$lang)
{
 $cmssql="select  * from sbs_cms_all WHERE cms_id ='$cmsid' LIMIT 0,1";
 $cmsquery =mysql_query($cmssql) or die ($cmssql);
 while($cmsrow = mysql_fetch_array($cmsquery)) {
if($lang =="th")
	 {
echo $cmsrow["cms_bsbser"];
	 }
elseif($lang =="en")
 	 {
echo $cmsrow["cms_bsbser_eng"];
	 }
}
}



function get_bb($task,$id,$lang,$site)
{
 $cmssql="select  * from sbs_bb WHERE bb_id ='$id' LIMIT 0,1";
 $cmsquery =mysql_query($cmssql) or die ($cmssql);
 while($cmsrow = mysql_fetch_array($cmsquery)) {
if($task=="1"){
if($lang =="th")
	 {
$content =  $cmsrow["bb_content1"];
	 }
elseif($lang =="en")
 	 {
$content =  $cmsrow["bb_content_eng1"];
	 }
$icon    =  $cmsrow["bb_icon1"];
$bsbser  =  $cmsrow["bb_pic1"];
}
if($task=="2"){
if($lang =="th")
	 {
$content =  $cmsrow["bb_content2"];
	 }
elseif($lang =="en")
 	 {
$content =  $cmsrow["bb_content_eng2"];
	 }
$icon    =  $cmsrow["bb_icon2"];
$bsbser  =  $cmsrow["bb_pic2"];
}
if($task=="3"){
if($lang =="th")
	 {
$content =  $cmsrow["bb_content3"];
	 }
elseif($lang =="en")
 	 {
$content =  $cmsrow["bb_content_eng3"];
	 }
	$icon    =  $cmsrow["bb_icon3"];
$bsbser  =  $cmsrow["bb_pic3"];
}
$content_bb = $content;
$bsbser_bb	= $bsbser;
$icon_bb    = $icon;
}
if($site =="1"){
echo  $content_bb;
}
if($site =="2"){
echo  $bsbser_bb;
}
if($site =="3"){
echo  $icon_bb;
}
}




function get_kn($id,$lang,$site)
{
 $cmssql="select  * from sbs_kn WHERE kn_id ='$id' LIMIT 0,1";
 $cmsquery =mysql_query($cmssql) or die ($cmssql);
 while($cmsrow = mysql_fetch_array($cmsquery)) {
if($lang =="th")
	 {
$content =  $cmsrow["kn_longdes"];
$name    =  $cmsrow["kn_name"];
	 }
elseif($lang =="en")
 	 {
$content =  $cmsrow["kn_longdes_eng"];
$name    =  $cmsrow["kn_name_eng"];
	 }
$bsbser  =  $cmsrow["kn_bsbser"];
}

if($site =="1"){
return  $content;
}
if($site =="2"){
return  $bsbser;
}
if($site =="3"){
return  $name;
}

}


function Getconfiglist($val)
{
$sql="SELECT * FROM sbs_config where cof_var ='$val' LIMIT 0,1";
$result=mysql_query($sql) or die ($sql);
$crow=mysql_fetch_array($result);
return $crow["cof_value"]-1;
}

function Getconfig($val)
{
$sql="SELECT * FROM sbs_config where cof_var ='$val' LIMIT 0,1";
$result=mysql_query($sql) or die ($sql);
$crow=mysql_fetch_array($result);
return $crow["cof_value"];
}
function getItem($SQL)
{
	$RESULT=mysql_query($SQL)or die($SQL);
	$ROW=mysql_fetch_array($RESULT);
	return $ROW[0];
}

function bb_show($address)
{
 $sql="SELECT * FROM sbs_bb WHERE bb_own='".$address."'";
 $result=mysql_query($sql) or die ($sql);
 $ROW=mysql_fetch_array($result);
              echo '<table width="964" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="312" align="left" valign="top" scope="col"><table id="Table_8" width="311" height="140" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td colspan="3"><img src="images/ban_01.png" width="312" height="19" alt="" /></td>
                </tr>
                <tr>
                  <td width="9"><img src="images/ban_02.png" width="9" height="109" alt="" /></td>
                  <td width="294" align="left" valign="top" background="images/ban_03.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <th height="30" align="left" valign="top" class="text-bold5" scope="col">',_supcomunity,'</th>
                    </tr>
                    <tr>
                      <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <th width="42%" align="left" valign="top" scope="col"><img src="datacenter/',$ROW["bb_icon1"],'" width="115" height="75" /></th>
                          <th width="58%" align="left" valign="top" class="text" scope="col" style="WORD-BREAK:BREAK-ALL;">',$ROW[_bb_content1_short],'<br /> <span class="link2"><a href="brandbsbser.php?tr_id=',$ROW["bb_id"],'&task=1" >',_readcon,'...</a></span></th>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
                  <td width="9"><img src="images/ban_04.png" width="9" height="109" alt="" /></td>
                </tr>
                <tr>
                  <td colspan="3"><img src="images/ban_05.png" width="312" height="12" alt="" /></td>
                </tr>
              </table></th>
    <th width="9" align="left" valign="top" scope="col">&nbsp;</th>
    <th width="312" align="left" valign="top" scope="col"><table id="Table_9" width="312" height="140" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td colspan="3"><img src="images/ban_01.png" width="312" height="19" alt="" /></td>
                </tr>
                <tr>
                  <td width="9"><img src="images/ban_02.png" width="9" height="109" alt="" /></td>
                  <td width="294" align="left" valign="top" background="images/ban_03.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <th height="30" align="left" valign="top" class="text-bold5" scope="col">',_developjob,'</th>
                    </tr>
                    <tr>
                      <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <th width="42%" align="left" valign="top" scope="col"><img src="datacenter/',$ROW["bb_icon2"],'" width="115" height="75" /></th>
                          <th width="58%" align="left" valign="top" class="text" scope="col" style="WORD-BREAK:BREAK-ALL;">',$ROW[_bb_content2_short],'<br /> <span class="link2"><a href="brandbsbser.php?tr_id=',$ROW["bb_id"],'&task=2">',_readcon,'...</a></span></th>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
                  <td width="9"><img src="images/ban_04.png" width="9" height="109" alt="" /></td>
                </tr>
                <tr>
                  <td colspan="3"><img src="images/ban_05.png" width="312" height="12" alt="" /></td>
                </tr>
              </table></th>
    <th width="10" align="left" valign="top" scope="col">&nbsp;</th>
    <th width="312" align="left" valign="top" scope="col"><table id="Table_9" width="312" height="140" border="0" cellpadding="0" cellspacing="0">
  <tr>
                  <td colspan="3"><img src="images/ban_01.png" width="312" height="19" alt="" /></td>
  </tr>
                <tr>
                  <td width="9"><img src="images/ban_02.png" width="9" height="109" alt="" /></td>
                  <td width="294" align="left" valign="top" background="images/ban_03.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <th height="30" align="left" valign="top" class="text-bold5" scope="col">',_suprivacy,'</th>
                    </tr>
                    <tr>
                      <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <th width="42%" align="left" valign="top" scope="col"><img src="datacenter/',$ROW["bb_icon3"],'" width="115" height="75" /></th>
                          <th width="58%" align="left" valign="top" class="text" scope="col" style="WORD-BREAK:BREAK-ALL;">',$ROW[_bb_content3_short],'<br /> <span class="link2"><a href="brandbsbser.php?tr_id=',$ROW["bb_id"],'&task=3">',_readcon,'...</a></span></th>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
                  <td width="9"><img src="images/ban_04.png" width="9" height="109" alt="" /></td>
                </tr>
                <tr>
                  <td colspan="3"><img src="images/ban_05.png" width="312" height="12" alt="" /></td>
                </tr>
</table></th>
  </tr>
</table>';
}

function photolib()
{
echo'<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> 
<script type="text/javascript" src="admin/js/jquery.colorbox.js"></script>
<link rel="stylesheet" href="admin/css/colorbox.css" />

<script> 
jQuery.noConflict();
		jQuery(document).ready(function(){
			//Examples of how to assign the ColorBox event to elements
			jQuery("a[rel=\'example1\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example2\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example3\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example4\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example5\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example6\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example7\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example8\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example9\']").colorbox({transition:"fade"});
			jQuery("a[rel=\'example10\']").colorbox({iframe:true, innerWidth:800, innerHeight:600});
			//Example of preserving a JavaScript event for inline calls.
			jQuery("#click").click(function(){ 
				jQuery(\'#click\').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
		});
	</script> ';
}

function topbsbser($pagenum,$lang,$task,$w,$h)
{
if($lang=="th"){$tlang="thai";}
if($lang=="en"){$tlang="eng";}

$sql="select  * from sbs_bsbser where ban_alias='".$pagenum."@".$tlang."'";
$query =mysql_query($sql)or die($sql);
$Row = mysql_fetch_array($query);

if($task =="1"){
echo"<img src=\"datacenter/".$Row['ban_file']."\" width=\"".$w."\" height=\"".$h."\">";
}
if($task =="2"){
echo $Row['note'];
}
if($task =="3"){
echo $Row['shortdes'];
}
}

function  usealist()
{
echo'<link type="text/css" href="css/aristo/jquery-ui-1.8.7.custom.css" rel="stylesheet" />	
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
		<script type="text/javascript">
			$(function(){
			
				// Autocomplete
				var countryList = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Busbsina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d\'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmasbs", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", " Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Tusbsey", "Tusbsmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
				$("#countries").autocomplete({
					source: countryList
				});

				// Accordion
				$(".accordion").accordion({ header: "h3" });
				$(".accordion").last().accordion("option", "icons", false);
	
				// Tabs
				$(\'#tabs\').tabs();

				// Dialog			
				$(\'#dialog\').dialog({
					autoOpen: false,
					width: 600,
					buttons: {
						"Ok": function() { 
							$(this).dialog("close"); 
						}, 
						"Cancel": function() { 
							$(this).dialog("close"); 
						} 
					},
					modal: true
				});
				
				// Dialog Link
				$(\'#dialog_link\').button().click(function(){
					$(\'#dialog\').dialog(\'open\');
					return false;
				});

				// Datepicker
				$(\'#datepicker\').datepicker().children().show();
				
				// Horizontal Slider
				$(\'#horizSlider\').slider({
					range: true,
					values: [17, 67]
				}).width(500);
				
				// Vertical Slider				
				$("#eq > span").each(function() {
					var value = parseInt($(this).text());
					$(this).empty().slider({
						value: value,
						range: "min",
						animate: true,
						orientation: "vertical"
					});
				});
				
				//hover states on the static widgets
				$(\'#dialog_link, ul#icons li\').hover(
					function() { $(this).addClass(\'ui-state-hover\'); }, 
					function() { $(this).removeClass(\'ui-state-hover\'); }
				);
				
				// Button
				$("#divButton, #linkButton").button();
								
				// Icon Buttons
				$("#leftIconButton").button({
					icons: {
						primary: \'ui-icon-wrench\'
					}
				});
				
				$("#bothIconButton").button({
					icons: {
						primary: \'ui-icon-wrench\',
						secondary: \'ui-icon-triangle-1-s\'
					}
				});					
				
				// Button Set
				$("#radio1").buttonset();
				
				
				// Progressbar
				$("#progressbar").progressbar({
					value: 37
				}).width(500);
				$("#animateProgress").click(function(event) {
					var randNum = Math.random() * 90;
					$("#progressbar div").animate( { width: randNum+"%" } );
					event.preventDefault();
				});
				
				// Combinations
				$(\'#tabs2\').tabs();
				$("#accordion2").accordion({ header: "h4" });
				$("#buttonInModal").button({
					icons: {primary: \'ui-icon-wrench\'}
				});
				
				// Nested button tests
				$("#nestedButtonTest_1, #nestedButtonTest_2, #buttonInModal").button().click(function(e) {
					e.preventDefault();
				});
				
			});
		</script>';

}
?>